/**
* @param waSystem $system
* @param array $options
* @return waSmarty3View
*/
public function __construct(waSystem $system, $options = array())
{
$this->smarty = new Smarty();
parent::__construct($system, $options);
if (isset($options['auto_literal'])) {
$this->smarty->auto_literal = $options['auto_literal'];
}
if (isset($options['left_delimiter'])) {
$this->smarty->left_delimiter = $options['left_delimiter'];
}
if (isset($options['right_delimiter'])) {
$this->smarty->right_delimiter = $options['right_delimiter'];
}
$this->smarty->setTemplateDir(isset($options['template_dir']) ? $options['template_dir'] : $system->getAppPath());
$this->smarty->setCompileDir(isset($options['compile_dir']) ? $options['compile_dir'] : $system->getAppCachePath('templates/compiled/'));
$this->smarty->setCacheDir($system->getAppCachePath('templates/cache/'));
if (ini_get('safe_mode')) {
$this->smarty->use_sub_dirs = false;
} else {
$this->smarty->use_sub_dirs = true;
}
// not use
//$this->smarty->setCompileCheck(wa()->getConfig()->isDebug()?true:false);
$this->smarty->addPluginsDir($system->getConfig()->getPath('system') . '/vendors/smarty-plugins');
$this->smarty->loadFilter('pre', 'translate');
}