假如smarty的边界符为{}

{$img_path|regex_replace:'/-s120\.jpg/':'-s145.jpg'}   替换   在nignx中rewrite了图片,后有图片格式都是pic.persy.cn/i/pic-s120.jpg,重写后,以-s数字   会去生成相应大小的图片,并非样式中的控制。

{$persy_str|escape} 去除特殊字符,以防字符串有含有恶意字符。

{$persy_name|truncate:80:" "}只显示80个字节,其余以空格替之。

{selling_price|string_format:"%.2f"}  数字格式。例如商品价格,两位小数

{$smarty.foreach.category.first}是否为第一个无素

{section name=list loop=$bnr start=0 max=3}
{if $smarty.section.list.index == 0}

{$smarty.section.com5.iteration}   section 的索引

posted on 2011-04-15 16:26  persy  阅读(155)  评论(0编辑  收藏  举报