Chapter 8. Custom Functions

Table of Contents
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 comes with several custom functions that you can use in the templates.

assign

属性名称TypeRequiredDefaultDescription
varstringYesn/aThe name of the variable being assigned
valuestringYesn/aThe value being assigned

assign is used for assigning template variables during the execution of the template.

Example 8-1. assign

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



The value of $name is {$name}.



OUTPUT:



The value of $name is Bob.