JerryJee

记录生活点滴.

smarty中使用function_register

Posted on 十一月 22nd, 2010 by Jerry Jee

我想在SMARTY模板中使用该方法,但是不想用PHP标签来实现
查过SMARTY手册有function_regiser可以实现,但是结果有问题
PHP的FUNCTION的显示:index.php?mod=mod&act=act&id=id
我这里的id用的是动态值

function Url($mod,$act,$plus){
extract($mod);  //一定要写这句
…..
}
$tpl->function_register(‘U’,Url);

smarty下这样调用<{U mod="mod" act="act" plus="&id="}><{$xxx}>
当然这里的id值要在php中assign
后面的id值要分开单独写

Popularity: 1%

No Responses to “smarty中使用function_register”

Leave a Response

You must be logged in to post a comment.