Пример #1
0
 private function getViewInstance()
 {
     $viewConfig = \Phalcon\DI::getDefault()->get('config')->application->view->toArray();
     $viewConfig['compileAlways'] = true;
     unset($viewConfig['cacheDir']);
     $view = new \Vegas\Mvc\View($viewConfig);
     $view->setDI(\Phalcon\DI::getDefault());
     return $view;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function register(\Phalcon\DiInterface $di)
 {
     //Set the views cache service
     $di->set(self::SERVICE_NAME, function () {
         $view = new \Vegas\Mvc\View();
         $view->setViewsDir('../app/views/');
         $view->registerEngines([".volt" => 'voltService']);
         return $view;
     });
 }
Пример #3
0
 private function setUpDI()
 {
     $di = $this->getDI();
     $di->set('view', function () use($di) {
         $view = new \Vegas\Mvc\View($di->get('config')->application->view->toArray());
         $path = $di->get('config')->application->moduleDir . 'Test/views';
         file_exists($path) && $view->setViewsDir($path);
         return $view;
     }, true);
     $di->set('exporter', function () use($di) {
         $exporter = new \Vegas\Exporter\Exporter();
         return $exporter->setDI($di);
     }, true);
 }