/** * instantiates smarty object and set major smarty configs * * @access public * @return void */ public function __construct() { parent::__construct(); $this->sTemplateDir = \mvc\registry::get('MVC_MODULES') . '/' . \mvc\Request::getInstance()->getModule() . '/templates'; $this->sTemplate = Registry::get('MVC_SMARTY_TEMPLATE_DEFAULT'); $this->iSmartyVersion = (int) preg_replace('/[^0-9]+/', '', self::SMARTY_VERSION); $this->setAbsolutePathToTemplateDir(); $this->setCompileDir(\MVC\Registry::get('MVC_SMARTY_TEMPLATE_CACHE_DIR')); $this->setCacheDir(\MVC\Registry::get('MVC_SMARTY_CACHE_DIR')); $this->caching = \MVC\Registry::get('MVC_SMARTY_CACHE_STATUS'); $aPlugInDir = array(\MVC\Registry::get('MVC_APPLICATION_PATH') . '/vendor/smarty/smarty/libs/plugins/'); \MVC\Registry::isRegistered('MVC_SMARTY_PLUGINS_DIR') ? $aPlugInDir = array_merge($aPlugInDir, \MVC\Registry::get('MVC_SMARTY_PLUGINS_DIR')) : false; $this->setPluginsDir($aPlugInDir); $this->checkDirs(); \MVC\Event::BIND('mvc.view.echoOut.off', function () { MVC_View::$bEchoOut = false; }); \MVC\Event::BIND('mvc.view.echoOut.on', function () { MVC_View::$bEchoOut = true; }); }