more dependency injection!

This commit is contained in:
Taylor Otwell
2011-08-31 00:07:45 -05:00
parent c200f3eb1e
commit c7ddbbb018
20 changed files with 118 additions and 223 deletions

View File

@@ -1,31 +1,20 @@
<?php namespace Laravel;
abstract class Controller {
abstract class Controller extends Resolver {
/**
* A stub method that will be called before every request to the controller.
*
* If a value is returned by the method, it will be halt the request process
* If a value is returned by the method, it will be halt the request cycle
* and will be considered the response to the request.
*
* @return mixed
*/
public function before() {}
/**
* Magic Method for getting items from the application instance.
*/
public function __get($key)
{
return IoC::resolve('laravel.application')->$key;
}
/**
* Magic Method to handle calls to undefined functions on the controller.
*/
public function __call($method, $parameters)
{
return IoC::resolve('laravel.application')->responder->error('404');
}
public function __call($method, $parameters) { return $this->response->error('404'); }
}