コード例 #1
0
ファイル: AbstractModel.php プロジェクト: nuxia/nuxia-plugin
 /**
  * @param string $format
  *
  * @return string
  */
 public function getResourceLocation($format = 'bundle')
 {
     $reflection = new \ReflectionClass(get_class($this));
     $namespace = $reflection->getNamespaceName();
     switch ($format) {
         case 'bundle':
             return Parser::getBundleClass($namespace);
             break;
         case 'namespace':
             return $namespace;
             break;
     }
 }
コード例 #2
0
ファイル: FileLoader.php プロジェクト: nuxia/nuxia-plugin
 /**
  * @param string $bundle
  * @param string $filepath
  *
  * @return string
  */
 public static function getFilePath($bundle, $filepath)
 {
     $bundleclass = Parser::getBundleClass($bundle);
     $reflection = new \ReflectionClass($bundleclass);
     return dirname($reflection->getFileName()) . '/' . $filepath;
 }