示例#1
0
function s_smarty_tpl($tpl)
{
    if (!is_file($tpl) || !is_readable($tpl)) {
        return s_err_arg('no suce file of ' . $tpl);
    }
    $smarty = s_smarty_object();
    try {
        return $smarty->fetch($tpl);
    } catch (SmartyException $se) {
        return s_log($se->getMessage());
    }
}
示例#2
0
function s_smarty_tpl($tpl, &$assign = false)
{
    if (!is_file($tpl) || !is_readable($tpl)) {
        return s_err_arg('no suce file of ' . $tpl);
    }
    $smarty = s_smarty_object();
    try {
        $smarty->assign($assign);
    } catch (SmartyException $se) {
    }
    return $smarty->fetch($tpl);
}