码迷,mamicode.com
首页 > 其他好文 > 详细

smarty变量调节器

时间:2016-07-24 12:04:21      阅读:143      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!