/** * Create new Smarty view * * @param string|array $paths Paths to templates directories * @param array $settings Smarty settings */ public function __construct($paths, $settings = []) { $this->smarty = new \Smarty(); $this->smarty->setTemplateDir($paths); if (isset($settings['cacheDir'])) { $this->smarty->setCacheDir($settings['cacheDir']); } if (isset($settings['compileDir'])) { $this->smarty->setCompileDir($settings['compileDir']); } if (isset($settings['pluginsDir'])) { $this->smarty->addPluginsDir($settings['pluginsDir']); } }
public function addExtionsions(Container $c, $extensions = array()) { $this->smartyInstance->registerObject('Container', $c); if (is_array($extensions)) { foreach ($extensions as $ext) { if (is_dir($ext)) { $this->smartyInstance->addPluginsDir(realpath($ext)); } else { $this->registerExtension($ext); } } } }