比如在tpl页面中我用了:onclick="<{$comdel}>"
在PHP页面中我写的是:
$smarty->register_function('comdel', 'comdela');
function comdela($params, &$smarty)
{
echo "<script>alert('1');</script>";
}
这样写为何不弹出1;请高手指点。
在PHP页面中我写的是:
$smarty->register_function('comdel', 'comdela');
function comdela($params, &$smarty)
{
echo "<script>alert('1');</script>";
}
这样写为何不弹出1;请高手指点。
{par1|函数名:par2:par3.....}
比如:
{$content|mb_strcut:0:800}
function add(str1,str2,int1){}smarty:
{add str1='aa' str2='bb' int1=110}
php:
$smarty->register_function('comdel', 'comdela');
function comdela($params)
{
extract($params); echo "<script>alert($str1);</script>";
}
smarty:
{comdel str1='aa' }