smarty 中 变量调节器(1)
2012-11-12 15:29
225 查看
变量调节器用于变量,自定义函数和字符串。请使用‘|’符号和调节器名称应用调节器。变量调节器由赋予的参数值决定其行为。参数由‘:’符号分开。
capitalize
将变量里的所有单词首字大写。
count_characters[字符计数]
计算变量里的字符数
cat[连接字符串]
将cat里的值连接到给定的变量后面.
count_paragraphs[计算段数]
计算变量里的词数
date_format[格式化日期]
Parameter Position Type Required Default Description
1 string No %b %e, %Y This is the format for the outputted date.
输出日期的格式。
2 string No n/a This is the default date if the input is empty.
输入为空时的默认时间格式。
This formats a date and time into the given strftime() format.
Dates can be passed to Smarty as unix timestamps, mysql timestamps or any string made up of month day year (parsable by strtotime).
Designers can then use date_format to have complete control of the formatting of the date.
If the date passed to date_format is empty and a second parameter is passed, that will be used as the date to format.
格式化从函数strftime()获得的时间和日期。
Unix或者mysql等的时间戳记(parsable by strtotime)都可以传递到smarty。
设计者可以使用date_format完全控制日期格式。
如果传给date_format的数据是空的,将使用第二个参数作为时间格式。
escape[编码]
Parameter Position Type Required Possible Values Default Description
1 string No html,htmlall,url,quotes,hex,hexentity,javascript html This is the escape format to use.
使用何种编码格式。
This is used to html escape, url escape, escape single quotes on a variable not already escaped, hex escape, hexentity or javascript escape. By default, the variable is html escaped.
用于html转码,url转码,在没有转码的变量上转换单引号,十六进制转码,十六进制美化,或者javascript转码。默认是html转码。
capitalize
将变量里的所有单词首字大写。
count_characters[字符计数]
计算变量里的字符数
cat[连接字符串]
将cat里的值连接到给定的变量后面.
count_paragraphs[计算段数]
计算变量里的词数
date_format[格式化日期]
Parameter Position Type Required Default Description
1 string No %b %e, %Y This is the format for the outputted date.
输出日期的格式。
2 string No n/a This is the default date if the input is empty.
输入为空时的默认时间格式。
This formats a date and time into the given strftime() format.
Dates can be passed to Smarty as unix timestamps, mysql timestamps or any string made up of month day year (parsable by strtotime).
Designers can then use date_format to have complete control of the formatting of the date.
If the date passed to date_format is empty and a second parameter is passed, that will be used as the date to format.
格式化从函数strftime()获得的时间和日期。
Unix或者mysql等的时间戳记(parsable by strtotime)都可以传递到smarty。
设计者可以使用date_format完全控制日期格式。
如果传给date_format的数据是空的,将使用第二个参数作为时间格式。
escape[编码]
Parameter Position Type Required Possible Values Default Description
1 string No html,htmlall,url,quotes,hex,hexentity,javascript html This is the escape format to use.
使用何种编码格式。
This is used to html escape, url escape, escape single quotes on a variable not already escaped, hex escape, hexentity or javascript escape. By default, the variable is html escaped.
用于html转码,url转码,在没有转码的变量上转换单引号,十六进制转码,十六进制美化,或者javascript转码。默认是html转码。
相关文章推荐
- PHP学习之路之Smarty变量调节器
- Smarty----变量调节器
- Smarty核心内容:变量调节器
- smarty配置以及变量调节器详解 推荐
- 三、smarty--变量调节器(修改器)
- Smarty变量调节器的使用
- smarty中变量调节器
- Smarty模板变量调节器用法分析
- 修改Smarty的变量调节器truncate无乱码截取中文
- smarty 模板编译和变量调节器 模板引入
- php学习笔记_Smarty变量调节器以及如何自定义
- Smarty变量调节器(1)
- smarty变量调节器
- Smarty变量与调节器详解
- 夺命雷公狗---Smarty NO:04 设计篇2 变量调节器
- Smarty字符串、函数变量调节器
- smarty模板变量调节器
- smarty 变量调节器(2)
- Smarty变量调节器的使用
- php学习笔记(三十七)smarty中的变量调节器使用