smarty变量调节器

Capitatize  首字母大写

 

 用法:<{$a|Capitatize}>

 

 Cat 连接字符串

 

用法:<{$money|cat:”$”}>

 

Count_characters   统计字符串的字数

 

Date_format  格式化日期

 

用法:<{$riqi|date_format:”%Y-%m-%d %H:%M:%S”}>

 

Default 默认值

 

用法:<{$moren|default:”hello”}>  如果赋值使用赋的值 如果没有赋值使用Hello

 

Indent 缩进

 

用法:<{$moren|indent}>

 

Lower 转小写

 

 用法:<{$a|lower}>

 

Regex_replace 正则替换

 

<{$moren|Regex_replace:”/\d/”:”qq”}>

 

Replace 替换

 

<{$moren|replace:”l”:”8”}>

 

Truncate 截取字符串  

 

 <{$jiequ|truncate:”8”:”...”}>

posted @ 2016-07-24 10:44  屈震  阅读(165)  评论(0编辑  收藏  举报