Added Response::error method.

This commit is contained in:
Taylor Otwell 2011-07-26 15:40:48 -05:00
parent 6b9b0ad5cd
commit 7bbee401b2
1 changed files with 12 additions and 0 deletions

View File

@ -101,6 +101,18 @@ public static function make($content, $status = 200)
return new static($content, $status); 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. * Take a value returned by a route and prepare a Response instance.
* *