Home > Backend Development > PHP Tutorial > smarty 里面, foreach 怎么计算上一个元素

smarty 里面, foreach 怎么计算上一个元素

WBOY
Release: 2016-06-06 20:16:12
Original
921 people have browsed it

<code class="phtml">


    

</code>
Copy after login
Copy after login

为什么不能计算, $ccc-1 哈? 其中 key 是数组的 .

回复内容:

<code class="phtml">


    

</code>
Copy after login
Copy after login

为什么不能计算, $ccc-1 哈? 其中 key 是数组的 .

好久不用smarty了,是不是$ccc是0


找到正解,用section,$foo[bar]这种仅在{section}循环的语法内可用,foreach不行

smarty 里面,  foreach 怎么计算上一个元素

参考:http://www.php100.com/manual/smarty/language.function.section.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template