/** * 构造函数 * * @param Application $app */ function __construct(&$app) { parent::__construct(&$app); $this->smarty = new Smarty(); isset($app->cfg['smarty']['template_dir']) && ($this->smarty->template_dir = $app->cfg['smarty']['template_dir']); isset($app->cfg['smarty']['compile_dir']) && ($this->smarty->compile_dir = $app->cfg['smarty']['compile_dir']); isset($app->cfg['smarty']['config_dir']) && ($this->smarty->config_dir = $app->cfg['smarty']['config_dir']); isset($app->cfg['smarty']['cache_dir']) && ($this->smarty->cache_dir = $app->cfg['smarty']['cache_dir']); isset($app->cfg['smarty']['debugging']) && ($this->smarty->debugging = $app->cfg['smarty']['debugging']); isset($app->cfg['smarty']['caching']) && ($this->smarty->caching = $app->cfg['smarty']['caching']); isset($app->cfg['smarty']['cache_lifetime']) && ($this->smarty->cache_lifetime = $app->cfg['smarty']['cache_lifetime']); isset($app->cfg['smarty']['left_delimiter']) && ($this->smarty->left_delimiter = $app->cfg['smarty']['left_delimiter']); isset($app->cfg['smarty']['right_delimiter']) && ($this->smarty->right_delimiter = $app->cfg['smarty']['right_delimiter']); $this->smarty->plugins_dir = SMARTY_DIR . 'plugins/'; $this->smarty->assign_by_ref('cfg', $app->cfg); $this->smarty->register_modifier('html', '_htmlspecialchars'); //设置默认的图片、样式、JS的模版路径 $this->value('url_js', $app->cfg['url']['js']); $this->value('url_images', $app->cfg['url']['images']); $this->value('url_css', $app->cfg['url']['css']); $this->value('site_title', $app->cfg['site']['title']); }
/** * 构造函数 * * @param Application $app */ function __construct(&$app) { parent::__construct(&$app); }