public function testThatDirPathCorrectlyReturnsAPathToADirectoryThatPhalconLikes() { $path = '/'; $this->assertEquals('/', dirPath($path)); $path = './'; $this->assertEquals('./', dirPath($path)); $path = '.'; $this->assertEquals('./', dirPath($path)); }
/** * Registers the View component in the DI container. * * @return void */ public function register() { $this->di->setShared('view', function () { $config = $this->di->get('config'); $view = new PhalconView(); $view->setViewsDir($config->paths->views); $view->registerEngines(['.volt' => function ($view, $di) use($config) { $volt = new VoltEngine($view, $di); $volt->setOptions(['compiledPath' => dirPath($config->paths->cache), 'compiledSeparator' => '_', 'compileAlways' => $config->debug]); return $volt; }, '.phtml' => 'Phalcon\\Mvc\\View\\Engine\\Php']); return $view; }); }
/** * Sets the application root directory. * * @param string */ public function setRootDirectory($rootDir) { $this->rootDir = dirPath($rootDir); }