Beispiel #1
0
 protected function getViewFilename($view)
 {
     $pos = strpos($view, ':');
     if (!$pos) {
         //no module has been supplied, so use the app directory
         return sprintf('%sapp/views/%s', $this->neptune->getRootDirectory(), $view);
     }
     //the template is in a module
     $module = substr($view, 0, $pos);
     $view = substr($view, $pos + 1);
     //check for an overriding template in the app/ folder
     $override = sprintf('%sapp/views/%s/%s', $this->neptune->getRootDirectory(), $module, $view);
     if (file_exists($override)) {
         return $override;
     }
     return sprintf('%sviews/%s', $this->neptune->getModuleDirectory($module), $view);
 }
Beispiel #2
0
 public function testGetRootDirectoryAppendsTrailingSlash()
 {
     $neptune = new Neptune('/no/trailing/slash');
     $this->assertSame('/no/trailing/slash/', $neptune->getRootDirectory());
 }