added shortcut for registering controllers in the ioc container.

This commit is contained in:
Taylor Otwell 2012-01-16 16:50:34 -06:00
parent f182ae277f
commit d50638cc75
1 changed files with 12 additions and 0 deletions

View File

@ -70,6 +70,18 @@ public static function instance($name, $instance)
static::$singletons[$name] = $instance; static::$singletons[$name] = $instance;
} }
/**
* Register a controller with the IoC container.
*
* @param string $name
* @param Closure $resolver
* @return void
*/
public static function controller($name, $resolver)
{
static::register("controller: {$name}", $resolver);
}
/** /**
* Resolve a core Laravel class from the container. * Resolve a core Laravel class from the container.
* *