<!--{foreach from=$news item=news name=foo}-->
<!--{if $smarty.foreach.foo.index <7}-->//循环$news中的前7条内容
<a href="#"><!--{$news.content_title}--></a>
<!--{/if}-->
<!--{/foreach}-->
Smarty 限制foreach的循环次数
最新推荐文章于 2021-03-11 02:57:14 发布