Exemplo n.º 1
1
 public function testThatDirPathCorrectlyReturnsAPathToADirectoryThatPhalconLikes()
 {
     $path = '/';
     $this->assertEquals('/', dirPath($path));
     $path = './';
     $this->assertEquals('./', dirPath($path));
     $path = '.';
     $this->assertEquals('./', dirPath($path));
 }
Exemplo n.º 2
0
 /**
  * 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;
     });
 }
Exemplo n.º 3
0
 /**
  * Sets the application root directory.
  * 
  * @param string
  */
 public function setRootDirectory($rootDir)
 {
     $this->rootDir = dirPath($rootDir);
 }