文章搜索:
·PHP技术论坛 ·PHP源码下载 ·招聘求职
好记性不如常笔记,学好PHP,需要养成做笔记的好习惯,马上申请我的在线笔记,终生免费>>
   你的位置: PHP教程部落 > PHP Smarty专题 > assign

assign

Chapter 8. Custom Functions

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.