鍍金池/ 教程/ PHP/ Smarty自定義函數(shù)
Smarty安裝
Smarty insert
Smarty 建立緩存
Smarty調(diào)試控制臺(tái)
Smarty if,elseif,else
Smarty include_php
Smarty多個(gè)緩存
Smarty方法
Smarty section,sectionelse
Smarty注釋代碼
Smarty屬性
Smarty緩沖處理函數(shù)
Smarty變量調(diào)節(jié)器
Smarty函數(shù)
Smarty組合修改器
Smarty雙引號(hào)里值的嵌入
Smarty預(yù)過濾器
Smarty foreach,foreachelse
Smarty include
Smarty Caching緩存
Smarty變量
Smarty assign用法
Smarty控制插件輸出緩沖
Smarty從配置文件讀取的變量
Smarty對(duì)象
Smarty literal
Smarty緩存集合
Smarty教程
Smarty display方法
Smarty自定義函數(shù)
Smarty配置文件
Smarty擴(kuò)展設(shè)置
Smarty數(shù)學(xué)運(yùn)算
Smarty輸出濾鏡
Smarty fetch方法

Smarty自定義函數(shù)

自定義函數(shù)

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 自帶的一組自定義函數(shù).

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 用于在模板被執(zhí)行時(shí)為模板變量賦值.


Example 8-1. assign
例 8-1. assign 函數(shù)演示

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

The value of $name is {$name}.

OUTPUT:

The value of $name is Bob.


上一篇:Smarty literal下一篇:Smarty include_php