Commit 7bbee401 by Taylor Otwell

Added Response::error method.

parent 6b9b0ad5
...@@ -102,6 +102,18 @@ class Response { ...@@ -102,6 +102,18 @@ class Response {
} }
/** /**
* Factory for creating new error response instances.
*
* @param int $code
* @param array $data
* @return Response
*/
public static function error($code, $data = array())
{
return static::make(View::make('error/'.$code, $data), $code);
}
/**
* Take a value returned by a route and prepare a Response instance. * Take a value returned by a route and prepare a Response instance.
* *
* @param mixed $response * @param mixed $response
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment