コード例 #1
0
function getWidgetStrCode($path, $arrParams)
{
    $strFuncParams = getFuncParams($arrParams);
    $path = trim($path, "\"");
    $fn = '"smarty_template_function_fis_' . strtr(substr($path, 0, strrpos($path, '/')), '/', '_') . '"';
    $strCode = '<?php ';
    $strCode .= 'if(is_callable(' . $fn . ')){';
    $strCode .= 'return call_user_func(' . $fn . ',$_smarty_tpl,' . $strFuncParams . ');';
    $strCode .= '}else{';
    $strCode .= '$fis_widget_output = $_smarty_tpl->getSubTemplate("' . $path . '", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, ' . $strFuncParams . ', Smarty::SCOPE_LOCAL);';
    $strCode .= 'if(is_callable(' . $fn . ')){';
    $strCode .= 'return call_user_func(' . $fn . ',$_smarty_tpl,' . $strFuncParams . ');';
    $strCode .= '}else{';
    $strCode .= 'echo $fis_widget_output;';
    $strCode .= '}';
    $strCode .= '}?>';
    return $strCode;
}
コード例 #2
0
function getWidgetStrCode($path, $arrParams)
{
    $strFuncParams = getFuncParams($arrParams);
    $path = trim($path, "\"");
    $fn = '"smarty_template_function_fis_' . strtr(substr($path, 0, strrpos($path, '/')), '/', '_') . '"';
    $strCode = '<?php ';
    $strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "<!--widget start ' . str_replace("\"", '\\"', $path) . '-->\\n";}';
    $strCode .= 'if(is_callable(' . $fn . ')){';
    $strCode .= 'return call_user_func(' . $fn . ',$_smarty_tpl,' . $strFuncParams . ');';
    $strCode .= '}else{';
    $strCode .= '$fis_widget_output = $_smarty_tpl->getSubTemplate("' . $path . '", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, ' . $strFuncParams . ', Smarty::SCOPE_LOCAL);';
    $strCode .= 'if(is_callable(' . $fn . ')){';
    $strCode .= 'return call_user_func(' . $fn . ',$_smarty_tpl,' . $strFuncParams . ');';
    $strCode .= '}else{';
    $strCode .= 'echo $fis_widget_output;';
    $strCode .= '}';
    $strCode .= 'if (array_key_exists(\'fis_debug\', $_GET)) {echo "\\n<!--widget end ' . str_replace("\"", '\\"', $path) . '-->";}';
    $strCode .= '}?>';
    return $strCode;
}