解析smarty模板中类似for的功能实现
时间:2023-11-15 12:53:40
1. 功能说明,在页面使用smarty循环100次输出,类似for循环100次
{section name=total loop=100}
{$smarty.section.total.index+1} //当前的索引
{$smarty.section.total.iteration} //用于显示循环的次数
{/section}
{assign var=i value=0}
{section name=total loop=100}
{assign var=i value=$i+1} {$i} //使用assign的方式赋值
{/section}
输出结果: 1 2 3 4 5 ... ... 100
标签:php,smarty模板
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
sql不常用函数总结以及事务,增加,删除触发器
2012-07-11 16:03:42
jquery实用技巧之输入框提示语句
2024-04-22 12:49:10
![](https://img.aspxhome.com/file/2023/1/136091_0s.jpg)
通过SQL Server的位运算功能巧妙解决多选查询方法
2024-01-22 01:21:26
python进行OpenCV实战之画图(直线、矩形、圆形)
2022-05-30 06:36:05
![](https://img.aspxhome.com/file/2023/9/71569_0s.jpg)
Python合并重叠矩形框
2023-06-11 02:33:41
![](https://img.aspxhome.com/file/2023/0/112460_0s.png)
Python3.遍历某文件夹提取特定文件名的实例
2022-12-08 04:48:59
js游戏 俄罗斯方块 源代码
2008-01-24 13:14:00
![](https://img.aspxhome.com/file/UploadPic/20081/24/200812414337986s.jpg)
ASP正则表达式技巧
2011-04-10 11:00:00
python中实现数组和列表读取一列的方法
2021-04-07 08:04:48
python如何解析复杂sql,实现数据库和表的提取的实例剖析
2024-01-21 06:37:51
pandas筛选某列出现编码错误的解决方法
2021-10-18 02:48:05
python fire库的使用实例教程
2023-08-24 14:01:22
![](https://img.aspxhome.com/file/2023/0/61760_0s.png)
python中的json模块常用方法汇总
2022-02-27 01:35:09
![](https://img.aspxhome.com/file/2023/3/103273_0s.png)
TensorFlow:将ckpt文件固化成pb文件教程
2021-01-24 11:33:45
pytorch 更改预训练模型网络结构的方法
2022-04-02 04:41:19
python打包成so文件过程解析
2022-03-19 18:08:46
ERROR 1862 (HY000): Your password has expired. To log in you must change it using a .....
2024-01-12 19:56:51
![](https://img.aspxhome.com/file/2023/0/81040_0s.png)
Python SELENIUM上传文件或图片实现过程
2021-12-22 09:11:53
![](https://img.aspxhome.com/file/2023/6/127636_0s.jpg)
DBCC CHECKIDENT 重置数据库标识列从某一数值开始
2024-01-15 11:16:27
Golang Gin 中间件 Next()方法示例详解
2024-02-20 07:29:22
![](https://img.aspxhome.com/file/2023/9/103059_0s.png)