/** * {@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; }); }
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); }