'Smarty - foreach stops while reaching a limit
i have a smarty foreach loop over a list of elements. this loop must stop when it complete 10 iteration, ie foreach must end at the 10th element of list.
{foreach $b_list as $list}
<label>{$list['firstname']}</label>
{/foreach}
Solution 1:[1]
{foreach $b_list as $list}
<label>{$list['firstname']}</label>
{if $list@iteration == 10}
{break}
{/if}
{/foreach}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | r_a_f |
