开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜