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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:16:12
Original
942 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
Latest Issues
smarty turns on caching garbled characters
From 1970-01-01 08:00:00
0
0
0
Why does tp use smarty template? ?
From 1970-01-01 08:00:00
0
0
0
How do you use smarty to integrate laravel5?
From 1970-01-01 08:00:00
0
0
0
Two ways to install smarty
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template