首页 > 其他 > 详细

smarty变量调节器

时间:2016-07-24 12:01:13      阅读:99      评论:0      收藏:0      [点我收藏+]

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

smarty变量调节器

原文:http://www.cnblogs.com/qz1234/p/5700247.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!