/** * Ethna_Renderer_Smartyクラスのコンストラクタ * * @access public */ function Ethna_Renderer_Smarty(&$controller) { parent::Ethna_Renderer($controller); $this->engine =& new Smarty(); // ディレクトリ関連は Controllerによって実行時に設定 // TODO: iniファイルによって上書き可にするかは要検討 $template_dir = $controller->getTemplatedir(); $compile_dir = $controller->getDirectory('template_c'); $this->setTemplateDir($template_dir); $this->compile_dir = $compile_dir; $this->engine->template_dir = $this->template_dir; $this->engine->compile_dir = $this->compile_dir; $this->engine->compile_id = md5($this->template_dir); // デリミタは Ethna_Config を見る $smarty_config = isset($this->config['smarty']) ? $this->config['smarty'] : array(); if (array_key_exists('left_delimiter', $smarty_config)) { $this->engine->left_delimiter = $smarty_config['left_delimiter']; } if (array_key_exists('right_delimiter', $smarty_config)) { $this->engine->right_delimiter = $smarty_config['right_delimiter']; } // コンパイルディレクトリは必須なので一応がんばってみる if (is_dir($this->engine->compile_dir) === false) { Ethna_Util::mkdir($this->engine->compile_dir, 0755); } $this->engine->plugins_dir = array_merge($controller->getDirectory('plugins'), array(ETHNA_BASE . '/class/Plugin/Smarty', SMARTY_DIR . 'plugins')); }
/** * Ethna_Renderer_Smartyクラスのコンストラクタ * * @access public */ function Ethna_Renderer_Smarty(&$controller) { parent::Ethna_Renderer($controller); $this->engine =& new Smarty(); $template_dir = $controller->getTemplatedir(); $compile_dir = $controller->getDirectory('template_c'); $this->setTemplateDir($template_dir); $this->compile_dir = $compile_dir; $this->engine->template_dir = $this->template_dir; $this->engine->compile_dir = $this->compile_dir; $this->engine->compile_id = md5($this->template_dir); // 一応がんばってみる if (is_dir($this->engine->compile_dir) === false) { Ethna_Util::mkdir($this->engine->compile_dir, 0755); } $this->engine->plugins_dir = array_merge($controller->getDirectory('plugins'), array(ETHNA_BASE . '/class/Plugin/Smarty', SMARTY_DIR . 'plugins')); }
/** * Ethna_Renderer_Rhacoクラスのコンストラクタ * * @access public */ function Ethna_Renderer_Rhaco(&$controller) { parent::Ethna_Renderer($controller); $this->template_dir = $controller->getTemplatedir() . '/'; $this->compile_dir = $controller->getDirectory('template_c'); Rhaco::constant('TEMPLATE_PATH', $this->template_dir); $this->engine =& new TemplateParser_Ethna(); /* $this->setTemplateDir($template_dir); $this->compile_dir = $compile_dir; */ $this->engine->template_dir = $this->template_dir; $this->engine->compile_dir = $this->compile_dir; $this->engine->compile_id = md5($this->template_dir); // 一応がんばってみる if (is_dir($this->engine->compile_dir) === false) { Ethna_Util::mkdir($this->engine->compile_dir, 0755); } $this->_setDefaultPlugin(); }