wnguh

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  smarty

摘要:Smarty中的分页有很多方法。1。使用Smarty的分页插件,如Pager,pagnition,sliding_page等,不过感觉都不是太好,几乎都有一些Bug。有兴趣试用和自己去改进的朋友可以看看:http://smarty.php.net/contribs/plugins/view.php/function.pager.phphttp://www.phpinsider.com/smarty-forum/viewtopic.php?t=2327http://www.phpinsider.com/smarty-forum/viewtopic.php?t=16042。使用分页类库,呵呵,这个 阅读全文
posted @ 2011-11-17 12:02 wnguh 阅读(2442) 评论(0) 推荐(0)

摘要:{section name="sn" loop="$BusinesList4"} <li><a href="#"><span>{$smarty.section.sn.index+1}</span>{$BusinesList4[sn].2}</a></li> {/section}可以看出,无论是索引还是关联数组用起来都是很方便。下面介绍下section中各个属性的说明:1、section中的属性name:(必选) 是section循环的名称只是标示循环唯一的名字没有 阅读全文
posted @ 2011-11-04 13:51 wnguh 阅读(5421) 评论(1) 推荐(1)

摘要:Smarty 中的 if 语句和 php 中的 if 语句一样灵活易用,并增加了几个特性以适宜模板引擎. if 必须于 /if 成对出现. 可以使用 else 和 elseif 子句. 可以使用以下条件修饰词:eq、ne、neq、gt、lt、lte、le、gte、ge、is even、is odd、is not even、is not odd、not、mod、div by、even by、odd by、==、!=、>、<、<=、>=. 使用这些修饰词时必须和变量或常量用空格格开.eq相等,ne、neq不相等,gt大于,lt小于,gte、ge大于等于,lte、le 小于等 阅读全文
posted @ 2011-11-04 11:26 wnguh 阅读(2315) 评论(0) 推荐(0)

摘要:capitalize [首字母大写] count_characters [计算字符数] cat [连接字符串] count_paragraphs [计算段落数]count_sentences [计算句数]count_words [计算词数]date_format [时间格式]default [默认]escape [转码]indent[缩进]lower[小写 ]nl2br[换行符替换成<br />]regex_replace[正则替换]replace[替换]spacify[插空]string_format[字符串格式化]strip[去除(多余空格)]strip_tags[去除html 阅读全文
posted @ 2011-11-03 15:36 wnguh 阅读(581) 评论(0) 推荐(0)