Пример #1
0
 /**
  * @param string $template
  * @param array  $data
  */
 public function __construct($template, array $data = array())
 {
     parent::__construct($template, $data);
     $conf = Registry::get('conf');
     $options = array('debug' => Value::ensureBoolean($conf['view']['haanga']['debug']), 'template_dir' => $this->path, 'autoload' => Value::ensureBoolean($conf['view']['haanga']['auto_reload']));
     if ($conf['view']['haanga']['cache'] === true) {
         $options['cache_dir'] = $this->path . '/haanga_cache';
     }
     require_once BASE_PATH . "Haanga/lib/Haanga.php";
     \Haanga::configure($options);
 }
Пример #2
0
 /**
  * @param string $template
  * @param array  $data
  */
 public function __construct($template, array $data = array())
 {
     parent::__construct($template, $data);
     $conf = Registry::get('conf');
     require_once BASE_PATH . "Twig/lib/Twig/Autoloader.php";
     \Twig_Autoloader::register();
     $options = array('debug' => Value::ensureBoolean($conf['view']['twig']['debug']), 'auto_reload' => Value::ensureBoolean($conf['view']['twig']['auto_reload']));
     if ($conf['view']['twig']['cache'] === true) {
         $options['cache'] = $this->path . '/twig_cache';
     }
     // define the Twig environment.
     $this->twig = new \Twig_Environment(new \Twig_Loader_Filesystem(array($this->path)), $options);
 }