Smarty自定义函数 - Smarty教程™

自定义函数

assign

counter

cycle

debug

eval

fetch

html_checkboxes

html_image

html_options

html_radios

html_select_date

html_select_time

html_table

math

mailto

popup_init

popup

textformat

 

用户可以使用 Smarty 自带的一组自定义函数.

assign

Attribute Name Type Required Default 描述
var string Yes n/a The name of the variable being assigned
value string Yes n/a The value being assigned

属性 类型 是否必须 缺省值 描述
var string Yes n/a 被赋值的变量名
value string Yes n/a 赋给变量的值

 

assign 用于在模板被执行时为模板变量赋值.


Example 8-1. assign
例 8-1. assign 函数演示

{assign var="name" value="Bob"}

The value of $name is {$name}.

OUTPUT:

The value of $name is Bob.


本站代码下载:http://www.yiibai.com/siteinfo/download.html

本文属作者原创,转载请注明出处:易百教程 » Smarty自定义函数