added shortcut for registering controllers in the ioc container.
This commit is contained in:
parent
f182ae277f
commit
d50638cc75
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue