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}

smarty循环的更多相关文章

  1. smarty循环item命名规范

    使用smarty循环渲染数据时第二次循环item复制命名不规范 item=data 后面代码使用data会与后台返回数据冲突 {%foreach from=$data.bind_data key=ke ...

  2. smarty 循环一维关联数组

    <?php $oStatusList = array('1'=>'待投放','2'=>'正在运行','3'=>'暂停','4'=>'已完成','5'=>'已删除') ...

  3. smarty在循环的时候计数来显示这是第几次循环的功能

    想必有很多人比较喜欢这个smarty循环的时候有个变量增加的功能或比较需要这个功能吧?其实不需要额外的变量,当然你也许根本用不了.我们用smarty内置的就可以了.就是smarty有foreach和s ...

  4. smarty使用

    smarty-牛刀小试 smarty 初识 官网 http://www.smarty.net/ Smarty is a template engine for PHP(PHP模板引擎) smarty使 ...

  5. 转载-smarty教程(基本语法)

    转自:http://hi.baidu.com/qxxgvpdtzhbckpr/item/681049160d7be60db98a1aec 1.smarty的配置      首先,使用smarty第一件 ...

  6. smarty模板中类似for的功能实现

    1. 功能说明,在页面使用smarty循环100次输出,类似for循环100次 {section name=total loop=100} {$smarty.section.total.index+1 ...

  7. 模板引擎(smarty)知识点总结五

    ---------重点知识:循环------------ /*   smarty 循环之for循环 */ /*    基本的语法         {for $i=$start to $end step ...

  8. PHP-深入学习Smarty

    本文中的边界标签分别为"<{"和"}>" start-12, 都是静态模板中的内容, 即使函数也只是模板中的标签或者变量调解器; 13-end, 都 ...

  9. smarty模板及其应用

    Smarty是一个使用PHP写出来的模板引擎,是目前业界最著名的PHP模板引擎之一.它分离了逻辑代码和外在的内容,提供了一种易于管理和使用的方法,用来将原本与HTML代码混杂在一起PHP代码逻辑分离. ...

随机推荐

  1. MySQL字符编码问题,Incorrect string value

    MySQL上插入汉字时报错例如以下.详细见后面分析. Incorrect string value: '\xD0\xC2\xC8A\xBEW' for column 'ctnr' at row 1 M ...

  2. Hadoop读书笔记(一)Hadoop介绍

    1.Hadoop是什么? 适合大数据的分布式与计算平台. HDFS:Hadoop Distributed File System 分布式文件系统  MapReduce:并行计算框架 2.HDFS的架构 ...

  3. IT人都很忙(茫)

    我发现,身边的盆友都很忙,要么在加班,要么加班刚回家:要么在出差,要么刚出差回来. 难道搞IT的人都很忙么?忙还是茫? 大学期间,不知道未来要干什么,很多人也不清楚应该学习哪些知识和技能,是否需要考证 ...

  4. 一文看懂AI芯片竞争五大维度

    下一波大趋势和大红利从互联网+让位于人工智能+,已成业界共识.在AI的数据.算法和芯片之三剑客中,考虑到AI算法开源的发展趋势,数据与芯片将占据越来越重要的地位,而作为AI发展支柱的芯片更是AI业的竞 ...

  5. [outlook] [vba] Highlight text in body of incoming emails

    http://www.outlookcode.com/threads.aspx?forumid=2&messageid=33313 Sub CustomMailMessageRule(MyMa ...

  6. [Node.js] Provide req.locals data though middleware

    We can create Template Helpers, which can contains some common reuseable data and libs. /* This is a ...

  7. null与对象的复杂关系(typeof null的结果是object的原因)

    原文 简书原文:https://www.jianshu.com/p/c1608452d056 前言 对象是 JavaScript 的基础.在 JavaScript 中一共有六种主要类型(术语是“语言类 ...

  8. [Angular] Zones and NgZone

    NgZone, Angular uses it to profiling all the async actions such as setTimeout, http request and anim ...

  9. [SCSS] Write similar classes with the SCSS @for Control Directive

    Writing similar classes with minor variations, like utility classes, can be a pain to write and upda ...

  10. Objective-C中 ==、isEqual、isEqualToString判断字符串相等

    图片发自简书App 在判断一个字符串类型的变量是否与某字符时相等,你可能写下这样一行代码 if (activityType == @"0"){} //activityType是某一 ...