lithium\core\Libraries::_params()
Get params from type.
Parameters
-
string
$type
-
string
$name
default: '*'
Returns
arraytype, namespace, class, name
Source
protected static function _params($type, $name = "*") {
if (!$name) {
$name = '*';
}
$library = $namespace = $class = '*';
if ($type && strpos($type, '.') !== false) {
$parts = explode('.', $type);
$type = array_shift($parts);
switch (count($parts)) {
case 1:
list($class) = $parts;
break;
case 2:
list($namespace, $class) = $parts;
break;
default:
$class = array_pop($parts);
$namespace = join('\\', $parts);
break;
}
}
if (strpos($name, '.') !== false) {
$parts = explode('.', $name);
$library = array_shift($parts);
$name = array_pop($parts);
$namespace = $parts ? join('\\', $parts) : "*";
}
return compact('library', 'namespace', 'type', 'class', 'name');
}