* // Returns "user/profile"...
* $file = static::controller('User_Profile_Controller');
*
*
* @param string $class
* @return string
*/
protected static function controller($class)
{
$controller = str_replace(array('_', '_Controller'), array('/', ''), $class);
return CONTROLLER_PATH.strtolower($controller).EXT;
}
/**
* Register an array of class to path mappings.
*
* The mappings will be used to resolve file paths from class names when
* a class is lazy loaded through the Autoloader, providing a faster way
* of resolving file paths than the typical file_exists method.
*
*
* // Register a class mapping with the Autoloader
* Autoloader::maps(array('User' => MODEL_PATH.'user'.EXT));
*
*
* @param array $mappings
* @return void
*/
public static function maps($mappings)
{
foreach ($mappings as $class => $path)
{
static::$mappings[$class] = $path;
}
}
/**
* Register PSR-0 libraries with the Autoloader.
*
* The library names given to this method should match directories within
* the application libraries directory. This method provides an easy way
* to indicate that some libraries should be loaded using the PSR-0
* naming conventions instead of the Laravel conventions.
*
*
* // Register the "Assetic" library with the Autoloader
* Autoloader::libraries('Assetic');
*
* // Register several libraries with the Autoloader
* Autoloader::libraries(array('Assetic', 'Twig'));
*
*
* @param array $libraries
* @return void
*/
public static function libraries($libraries)
{
static::$libraries = array_merge(static::$libraries, (array) $libraries);
}
}