php_handling = SMARTY_PHP_ALLOW; $smarty->compile_dir = DATADIR . '/template_c'; $smarty->debugging = true; $smarty->error_reporting = E_ALL; $smarty->left_delimiter = '<%'; $smarty->right_delimiter = '%>'; $this->setSmarty($smarty); } function __set ($name, $value) { $this->getSmarty()->assign($name, $value); } function __get($name) { return $this->getSmarty()->get_template_vars($name); } function __isset ($name) { $result = $this->getSmarty()->get_template_vars($name); return isset($result); } function renderContent () { $this->getSmarty()->template_dir = $this->getRootDirectory(); $result = $this->getSmarty()->fetch($this->getResourceName() . EXT); return $result; } function onContent ($view) { foreach ($this->getSmarty()->get_template_vars() as $var => $value) { $view->$var = $value; } } private function getResourceName () { $result = $this->getName(); if ($this->hasDirPrefix()) { $result = $this->getDirPrefix() . $result; } return $result; } function setSmarty (Smarty $smarty) { $this->smarty = $smarty; } function getSmarty () { return $this->smarty; } }