Ejemplo n.º 1
0
 /**
  * Transform dot-separated component name to full namespace
  * @param type $name
  * @return type
  */
 public static function getComponentNamespace($name)
 {
     return fx::cache('array')->remember('component_namespace_' . strtolower($name), function () use($name) {
         $name = fx::getComponentFullName($name);
         $path = explode(".", $name);
         if ($path[0] === 'floxim' && $path[1] === 'component') {
             array_unshift($path, "floxim");
         }
         foreach ($path as &$part) {
             $chunks = explode("_", $part);
             foreach ($chunks as &$chunk) {
                 $chunk = ucfirst($chunk);
             }
             $part = join('', $chunks);
         }
         $res = '\\' . join('\\', $path);
         return $res;
     });
 }