摘要:
insert用于模板中。用法:{insert name="method_name"}此时会寻找php文件中方法名为:insert_method_name的函数,将其返回值作为insert语句的值。例子: template_dir = "./templates"; //模板存放目录 $smarty -> compile_dir = "./templates_c"; //编译目录 $smarty -> cache_dir = "./cache"; //缓存目录 $smarty -> config_di 阅读全文
posted @ 2013-10-26 23:29
无忧之路
阅读(1398)
评论(0)
推荐(0)
摘要:
require("Smarty.class.php"); $smarty = new Smarty(); $smarty -> template_dir = "./templates"; //模板存放目录 $smarty -> compile_dir = "./templates_c"; //编译目录 $smarty -> cache_dir = "./cache"; //缓存目录 $smarty -> config_dir = "./configs"; //缓存目录 阅读全文
posted @ 2013-10-26 01:34
无忧之路
阅读(361)
评论(0)
推荐(0)
摘要:
文件:section.tpl{section name=color loop=$colors}{*这里是非关联数组,只是普通数组,这里的形式为:下标=>值 *}{$smarty.section.color.index} => {$colors[color]}{/section}文件:section.php template_dir = "./templates"; //模板存放目录 $smarty -> compile_dir = "./templates_c"; //编译目录 $smarty -> cache_dir = &qu 阅读全文
posted @ 2013-10-26 01:31
无忧之路
阅读(239)
评论(0)
推荐(0)
摘要:
在template中,要注意{foreach from=$arr item=value}其中的value不需要$美元符号 阅读全文
posted @ 2013-10-26 00:30
无忧之路
阅读(224)
评论(0)
推荐(0)

浙公网安备 33010602011771号