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”:”...”}>

原文地址:https://www.cnblogs.com/qz1234/p/5700247.html