定义模块函数:
<?php
function smarty_block_text($args,$content,$smarty,$a)
{
$color=$args["color"];
$size=$args["size"];
if(!$a)
{
$content = "<span style='color:{$color};font-size:{$size}'>{$content}</span>";
}
return $content;
}
引用:
<{text color='red' size='30px'}>
hello
<{/text}>