smarty自定义函数

来源:互联网 发布:顶级hifi音频总店淘宝 编辑:程序博客网 时间:2024/06/05 09:45
 

smarty自定义函数assign

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

函数名称:assign

参数:var:   声明变量名称  字符串

      Value: 给该变量赋值  字符串

<{assign  var=”title”  value=”this is title”}>

    $tpl->assign(“title”,”this is title”);

练习:

  使用自定义函数分配变量 content,对应值为abc;

<input  type=”text”  name=”input1”>

 属性无顺序要求

<{config_load  file=”*.conf”  section=”one”}>