Exemplo n.º 1
0
 public function __construct(\Phalcon\Mvc\ViewBaseInterface $view, \Phalcon\DiInterface $di)
 {
     parent::__construct($view, $di);
     require CORE_PATH . 'config/volt.functions.php';
     foreach ($voltFunctions as $macro => $function) {
         $this->getCompiler()->addFunction($macro, $function);
     }
     $this->getCompiler()->setOptions(array('stat' => true, 'compileAlways' => true));
 }
Exemplo n.º 2
0
 public function __construct(ViewBaseInterface $view, DiInterface $di = null)
 {
     parent::__construct($view, $di);
     $debug = false;
     if (config()->app->debug) {
         $debug = true;
     }
     $this->setOptions(['compiledSeparator' => '_', 'compiledPath' => storage_path('views') . '/', 'compileAlways' => $debug]);
     foreach ($this->functions as $func) {
         $this->getCompiler()->addFunction($func, $func);
     }
 }
Exemplo n.º 3
0
 public function __construct(ViewBaseInterface $view, DiInterface $dependencyInjector, $development = true, $prefix = '')
 {
     parent::__construct($view, $dependencyInjector);
     $this->setOptions(['compiledPath' => function ($templatePath) use($view, $development, $prefix) {
         $dir = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'volt-cache';
         if (!is_dir($dir)) {
             mkdir($dir);
         }
         if ($prefix !== '') {
             $prefix .= '%';
         }
         return $dir . DIRECTORY_SEPARATOR . $prefix . str_replace(DIRECTORY_SEPARATOR, '%', str_replace($view->getViewsDir(), '', $templatePath)) . '.php';
     }, 'compileAlways' => $development]);
 }
Exemplo n.º 4
0
 public function __construct($a, $b)
 {
     // $this->log = new \Phalcon\Logger\Adapter\File(getcwd().'/view.log');
     parent::__construct($a, $b);
 }
Exemplo n.º 5
0
 public function __construct($view, $dependencyInjector = null)
 {
     parent::__construct($view, $dependencyInjector);
 }