more refactoring and changes.

This commit is contained in:
Taylor Otwell
2011-09-08 17:49:16 -05:00
parent 03654fc5a1
commit abc1fad6c1
34 changed files with 883 additions and 482 deletions

View File

@@ -2,13 +2,6 @@
abstract class Controller {
/**
* The IoC container instance.
*
* @var Container
*/
public $container;
/**
* A stub method that will be called before every request to the controller.
*
@@ -28,15 +21,26 @@ abstract class Controller {
*/
public function __call($method, $parameters)
{
return $this->container->resolve('laravel.response')->error('404');
return IoC::container()->resolve('laravel.response')->error('404');
}
/**
* Magic Method for retrieving items out of the IoC container.
* Dynamically resolve items from the application IoC container.
*/
public function __get($key)
{
return $this->container->$key;
$container = IoC::container();
if ($container->registered('laravel.'.$key))
{
return $container->resolve('laravel.'.$key);
}
elseif ($container->registered($key))
{
return $container->resolve($key);
}
throw new \Exception("Attempting to access undefined property [$key] on controller.");
}
}