protected static function _initTemplatesPath() { if (!isset(self::$templatesPath)) { $config = Oops_Server::getConfig(); $oopsConfig = $config->get('oops'); if (is_object($oopsConfig)) { self::$templatesPath = $oopsConfig->get('templates_path'); } if (!strlen(self::$templatesPath)) { self::$templatesPath = './application/templates'; } if (!is_dir(self::$templatesPath)) { throw new Exception("Template_Helper/Invalid templates path :: " . self::$templatesPath); } } }
/** * @param string template name * @access private */ private function __construct($tplName) { /** * Numbering templates */ static $num = 0; $this->_num = ++$num; $this->_tplName = $tplName; // @todo move helper initialization to static method require_once 'Oops/Template/Helper.php'; try { /** * Obtain template file name */ $this->_tplFile = Oops_Template_Helper::getTemplateFilename($tplName); } catch (Exception $e) { trigger_error($e->getMessage(), E_USER_ERROR); $this->_valid = false; } }