|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
SGBoise Smarty Rookie
Joined: 28 Mar 2008 Posts: 27 Location: GamePacks.org
|
Posted: Mon Nov 10, 2008 6:58 am Post subject: Is this possible {$tms_categories|@count + 1}? |
|
|
Hello,
I want to get the count of the array but add 1 to it. I don't want to determine the value in php if I don't have to.
Code: | <ul id="s{$tms_categories|@count + 1}"> |
Is this possible?
Thanks. _________________ GamePacks.org - Products for the Arcade/Media Community
Video Script - The ultimate media site script
AutoVideoScript.com - Run your own youtube sharing site |
|
Back to top |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
Posted: Mon Nov 10, 2008 7:25 am Post subject: |
|
|
Try
Code: | {1+$tms_categories|@count} |
If you can't get it to work take a look at the {math} function. _________________ Darn computers always do what I tell them to instead of what I want them to do. |
|
Back to top |
|
SGBoise Smarty Rookie
Joined: 28 Mar 2008 Posts: 27 Location: GamePacks.org
|
Posted: Mon Nov 10, 2008 8:22 am Post subject: |
|
|
Thanks Celeb.
That didn't work. The documentation said it was pretty expensive to run {math} function. I'll just do it in php and assign it.
Thanks again. _________________ GamePacks.org - Products for the Arcade/Media Community
Video Script - The ultimate media site script
AutoVideoScript.com - Run your own youtube sharing site |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Wed Nov 12, 2008 1:51 pm Post subject: |
|
|
Celeb wrote: | Try
Code: | {1+$tms_categories|@count} |
If you can't get it to work take a look at the {math} function. |
i could be wrong, but i don't think you need the @ sign, since you're not dealing with arrays. |
|
Back to top |
|
Celeb Administrator
Joined: 17 Apr 2007 Posts: 1025 Location: Vienna
|
Posted: Wed Nov 12, 2008 5:01 pm Post subject: |
|
|
How is he not dealing with arrays? In his first post he said he wanted to count the elements of an array. _________________ Darn computers always do what I tell them to instead of what I want them to do. |
|
Back to top |
|
SGBoise Smarty Rookie
Joined: 28 Mar 2008 Posts: 27 Location: GamePacks.org
|
Posted: Thu Nov 13, 2008 8:27 pm Post subject: |
|
|
$tms_categories is an array but I did get it to work php and just assigned it.
Thanks. _________________ GamePacks.org - Products for the Arcade/Media Community
Video Script - The ultimate media site script
AutoVideoScript.com - Run your own youtube sharing site |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|