Beispiel #1
0
 /**
  * @return \Nano\Helper
  * @param string $name
  *
  * @throws \Nano\Exception\HelperNotFound
  */
 protected function search($name)
 {
     $className = \Nano\Names::helperClass($name);
     if (class_exists($className, false)) {
         return $className;
     }
     $classPath = \Nano\Names::applicationFile($className);
     if (!\Nano::app()->loader->loadFileWithClass($className, $classPath)) {
         throw new \Nano\Exception\HelperNotFound($name);
     }
     return new $className();
 }
Beispiel #2
0
 public function testConvertAppPluginsClassToFile()
 {
     $root = Nano::app()->rootDir . '/plugins';
     self::assertEquals($root . DS . 'Some.php', \Nano\Names::applicationFile('\\App\\Plugin\\Some'));
     self::assertEquals($root . DS . 'Some' . DS . 'Other.php', \Nano\Names::applicationFile('\\App\\Plugin\\Some\\Other'));
 }