/** * render a .tpl */ public function render($tpl, $parames = array()) { if (base_Constant::TEMP_DIR) { $tpl = base_Constant::TEMP_DIR . '/' . $tpl; } if (!self::$engine) { self::$engine = new Smarty(); self::$engine->plugins_dir = array(SMARTY_DIR . "/plugins_slightphp/", SMARTY_DIR . "/plugins/"); self::$engine->compile_dir = SlightPHP::$appDir . DIRECTORY_SEPARATOR . "v_t"; self::$engine->template_dir = SlightPHP::$appDir . DIRECTORY_SEPARATOR . "v"; } foreach ($parames as $key => $value) { self::$engine->assign($key, $value); } return self::$engine->fetch($tpl, $parames); }
/** * render a .tpl */ public function render($tpl, $parames = array()) { if (base_Constant::TEMP_DIR) { $tpl = base_Constant::TEMP_DIR . '/' . $tpl; } if (!self::$engine) { self::$engine = new Smarty(); self::$engine->plugins_dir = array(SMARTY_DIR . "/plugins_slightphp/", SMARTY_DIR . "/plugins/"); $c_dir = "saemc://" . $_SERVER['HTTP_APPVERSION'] . "/v_t/"; if (!is_dir($c_dir)) { @mkdir($c_dir); } self::$engine->compile_dir = $c_dir; self::$engine->template_dir = SlightPHP::$appDir . DIRECTORY_SEPARATOR . "v"; self::$engine->compile_locking = false; } foreach ($parames as $key => $value) { self::$engine->assign($key, $value); } return self::$engine->fetch($tpl, $parames); }