added facades and made other ioc improvements.

This commit is contained in:
Taylor Otwell
2011-08-30 22:09:47 -05:00
parent 501953f2db
commit 0ef96fb8d0
27 changed files with 271 additions and 276 deletions

View File

@@ -57,8 +57,6 @@ 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);
}
@@ -154,6 +152,34 @@ class Response {
$this->status = $status;
}
/**
* Create a new response instance.
*
* @param mixed $content
* @param int $status
* @return Response
*/
public static function make($content, $status = 200)
{
return IoC::container()->resolve('laravel.response')->make($content, $status);
}
/**
* Create a new error response instance.
*
* The response status code will be set using the specified code.
*
* Note: The specified error code should correspond to a view in your views/error directory.
*
* @param int $code
* @param array $data
* @return Response
*/
public static function error($code, $data = array())
{
return IoC::container()->resolve('laravel.response')->error($code, $data);
}
/**
* Get the evaluated string contents of the response.
*