|
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 |
Serpent Driver Smarty n00b
Joined: 19 Oct 2016 Posts: 1
|
Posted: Wed Oct 19, 2016 9:46 am Post subject: Smarty counter in (splitted) array |
|
|
Hi all,
is there a smarty function like {counter} in foreach that continues counting if the array is splitted in more than 1 page?
{foreach name=aussen item=module_data from=$module_content}
{counter}
Output:
1
2
3
...
15
{/foreach}
next page
{foreach name=aussen item=module_data from=$module_content}
{counter}
Output:
1
2
3
...
15
{/foreach}
I've got a tipp to work with count and plus for every foreach loop instead of counter, but I don't know how. Can anyone help? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Oct 19, 2016 10:52 am Post subject: |
|
|
How it is a Smarty question?
Each page is a separate PHP invocation, they can't possibly know what happened on the previous run, and if that previous run was ever performed.
YOU must make that information available for consecutive invocations. There's no magic involved. |
|
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
|