1、php文件中步骤:
1) 引入模板类文件smarty.class.php
2) 创建模板对象 $tpl
3) 分配变量 assign p550
4) 选择模板文件 display
html文件---变量为主
2、smarty中使用变量
1)模板中的注释
模板注释被*号包围,例如<{*this is a comment *}>
2)从php分配过来的变量
经过各种运算得到的结果
类型:
标量:string、int、float(double)、boolean
复合:array、object、null
从数据库获取
smarty3.1.4版
关联数组:使用点号“.”连接下标
索引数组:使用[ ]连接下标
自定义数组
对象
对象名->属性
对象名->方法( )