continued refactoring of view classes.

This commit is contained in:
Taylor Otwell
2011-08-29 19:27:02 -05:00
parent 15cde60794
commit 8229891d26
5 changed files with 43 additions and 11 deletions

View File

@@ -57,6 +57,8 @@ class Response_Factory {
*/
public function error($code, $data = array())
{
$data['homepage'] = IoC::resolve('laravel.config')->get('application.url');
return new Response($this->view->make('error/'.$code, $data), $code);
}
@@ -221,4 +223,14 @@ class Response {
return $this;
}
/**
* Magic Method for passing undefined static methods to the Response_Factory instance
* registered in the application IoC container. This provides easy access to the
* response functions while still maintaining testability within the classes.
*/
public static function __callStatic($method, $parameters)
{
return call_user_func_array(array(IoC::container()->resolve('laravel.response'), $method), $parameters);
}
}