public function __construct() { //smarty配置 if (!is_null(self::$smarty)) { return; } $smarty = new Smarty(); $smarty->template_dir = ROOT_PATH . APP_PATH . '/' . MODULE . APP_TPL_PATH . '/' . CONTROLLER . '/'; //模板目录 $smarty->compile_dir = APP_TEMP_PATH . '/Compile/' . MODULE . '/'; //模板编译目录 $smarty->cache_dir = APP_TEMP_PATH . '/Cache/' . MODULE . '/'; //模板缓存目录 if (!file_exists($smarty->cache_dir)) { Dir::create($smarty->cache_dir); } $smarty->left_delimiter = C('LEFT_DELIMITER'); //左边界符号 $smarty->right_delimiter = C('RIGHT_DELIMITER'); //右边界符 $smarty->caching = C('CACHE_ON'); //缓存开启 $smarty->cache_lifetime = C('CACHE_TIME'); //缓存时间 // $smarty->allow_php_templates = true; self::$smarty = $smarty; }
public function __construct() { if (is_null(self::$smarty)) { $smarty = new Smarty(); $smarty->template_dir = APP_TPL_PATH . '/' . CONTROLLER . '/'; $smarty->compile_dir = APP_COMPILE_PATH; $smarty->left_delimiter = C('SMARTY_LEFT_DELIMITER'); $smarty->right_delimiter = C('SMARTY_RIGHT_DELIMITER'); $smarty->cache_dir = APP_CACHE_PATH; $smarty->caching = C('SMARTY_CACHE_ON'); $smarty->cache_lifetime = C('SMARTY_CACHE_LIFETIME'); self::$smarty = $smarty; } }
public function __construct() { if (!is_null(self::$smarty)) { return; } $smarty = new Smarty(); $smarty->left_delimiter = C('LEFT_DELIMITER'); $smarty->right_delimiter = C('RIGHT_DELIMITER'); $smarty->template_dir = APP_TPL_PATH . '/' . CONTROLLER . '/'; $smarty->compile_dir = APP_COMPILE_PATH; $smarty->cache_dir = APP_CACHE_PATH; $smarty->caching = C('CACHE_ON'); $smarty->cache_lifetime = C("CACHE_TIME"); $smarty->unmuteExpectedErrors(); self::$smarty = $smarty; }
public function __construct() { //smarty配置 if (!is_null(self::$smarty)) { return; } $smarty = new Smarty(); $smarty->template_dir = APP_TPL_PATH . '/' . CONTROLLER . '/'; //模板目录 $smarty->compile_dir = APP_COMPILE_PATH; //模板编译目录 $smarty->cache_dir = APP_CACHE_PATH; //模板缓存目录 $smarty->left_delimiter = C('LEFT_DELIMITER'); //左边界符号 $smarty->right_delimiter = C('RIGHT_DELIMITER'); //右边界符 $smarty->caching = C('CACHE_ON'); //缓存开启 $smarty->cache_lifetime = C('CACHE_TIME'); //缓存时间 self::$smarty = $smarty; }