What's the difference between {foreach} and {section} in smarty?
Can someone provide an example that make i开发者_StackOverflowt clear?
{foreach} is used to loop over an associative array as well a numerically-indexed array,
{section} which is for looping over numerically-indexed arrays only
The syntax for {foreach} is much easier than {section}, but as a tradeoff it can only be used for a single array
You may take a look at the documentation which explains the differences and provides examples.
From the manual:
the syntax for {foreach} is much easier than {section}, but as a tradeoff it can only be used for a single array.
加载中,请稍侯......
精彩评论