コード例 #1
0
ファイル: LiteEngine.php プロジェクト: lukeme/lite
/**
 * 装载模板函数
 * @return function name
 */
function lite_render($path, $context)
{
    global $lite_engine;
    $file = $lite_engine->litecode . strtr($path, '/', '^') . '.php';
    $fn = 'lite_template' . str_replace(array('.', '/', '-', '!', '%'), '_', $path);
    if ($lite_engine->debug) {
        require "LiteService.php";
        $engine = new LiteService();
        $engine->debug($path, $context);
    } else {
        require_once $file;
        $fn($context);
    }
}