diff --git a/system/response.php b/system/response.php index c1734d2b..3a3f7dd6 100644 --- a/system/response.php +++ b/system/response.php @@ -101,6 +101,18 @@ public static function make($content, $status = 200) 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. *