Added Response::error method.
This commit is contained in:
@@ -101,6 +101,18 @@ class Response {
|
||||
return new static($content, $status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user