smarty
sudoers
这个作者很懒,什么都没留下…
展开
-
在模板里面使用php常量
<br />PHP<br /><?php define('CST','a string');<br />Smarty<br />{$smarty.const.CST}原创 2010-10-27 14:33:00 · 455 阅读 · 0 评论 -
使用smarty block功能自定义模板标签(更新版本)
使用smarty的block功能编写插件先看模板标记,加入行号功能 {foobar assign='row' name='test'} {$_bindex.test}{$row.id}{$row.title} {/foobar} 然后控制器原创 2010-11-02 20:28:00 · 8925 阅读 · 2 评论 -
使用smarty block功能自定义模板标签
更新至: http://blog.csdn.net/sudoers/article/details/5982987 使用smarty的block功能编写插件原创 2010-10-21 13:02:00 · 1334 阅读 · 0 评论 -
smarty 模版参数中的变量使用及变量的运算
SYNTAX EXAMPLES: {func var="test $foo test"} <-- sees $foo {func var="test $foo_bar test"} <-- sees $foo_bar {func var="test $foo[0] test"} <-- sees $foo[0] {func var="test $foo[bar] test"}转载 2012-11-05 10:01:33 · 864 阅读 · 0 评论 -
smarty 的模版配置文件的使用
Variables loaded from config files Variables that are loaded from the config files are referenced by enclosing them within hash marks (#), or with the smarty variable $smarty.config. The second synt转载 2012-11-05 10:08:13 · 431 阅读 · 0 评论 -
smarty block 功能实现 局部缓存
HTML部分 {nocache} {**some process**} {/nocache} nocache就是自定义block实现区块内数据的控制 function smarty_block_nocache($param, $content, $smarty) { return $content; } $smarty->register_bloc原创 2012-11-05 09:48:41 · 418 阅读 · 0 评论 -
Smarty 缓存控制
require('Smarty.class.php'); $smarty = new Smarty; $smarty->caching = true; $my_cache_id = $_GET['article_id']; if(!$smarty->is_cached('index.tpl',$my_cache_id)) { // No cache available, do var转载 2012-11-05 09:52:58 · 398 阅读 · 1 评论 -
smarty 输出前内容过滤
// put this in your application function protect_email($tpl_output, &$smarty) { $tpl_output = preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!', '$1%转载 2012-11-05 09:55:55 · 535 阅读 · 0 评论