autoload bundles based on namespace.

This commit is contained in:
Taylor Otwell
2012-02-19 21:59:57 -06:00
parent 106b5dc1e1
commit b262e743c0
2 changed files with 29 additions and 0 deletions

View File

@@ -361,6 +361,20 @@ function str_finish($value, $cap)
return rtrim($value, $cap).$cap;
}
/**
* Get the root namespace of a given class.
*
* @param string $class
* @return string
*/
function root_namespace($class)
{
if (str_contains($class, '\\'))
{
return head(explode('\\', $class));
}
}
/**
* Return the value of the given item.
*