ResponseFactoryInterface
interface ResponseFactoryInterface (View source)
Methods
Response
create(string $content, int $code = Response::HTTP_OK, array $headers = array())
Create a response
Response
json(array|object|JsonSerializable $data, int $code = Response::HTTP_OK, array $headers = array())
Create a response
Response
notFound(string $content, int $code = Response::HTTP_NOT_FOUND, array $headers = array())
Create a page not found response
Response
error(string $content, int $code = Response::HTTP_INTERNAL_SERVER_ERROR, array $headers = array())
Create an error response
Response
forbidden(string $requestUrl, int $code = Response::HTTP_FORBIDDEN, array $headers = array())
Create a forbidden response
Response
redirect(string $to, int $code = Response::HTTP_MOVED_PERMANENTLY, array $headers = array())
Create a redirect response
Response
Response
controller(Controller $controller, int $code = Response::HTTP_OK, array $headers = array())
Create a response from a controller object
Response
collection(Collection $collection, int $code = Response::HTTP_OK, array $headers = array())
Create a response from a collection object
Details
Response
create(string $content, int $code = Response::HTTP_OK, array $headers = array())
Create a response
Response
json(array|object|JsonSerializable $data, int $code = Response::HTTP_OK, array $headers = array())
Create a response
Response
notFound(string $content, int $code = Response::HTTP_NOT_FOUND, array $headers = array())
Create a page not found response
Response
error(string $content, int $code = Response::HTTP_INTERNAL_SERVER_ERROR, array $headers = array())
Create an error response
Response
forbidden(string $requestUrl, int $code = Response::HTTP_FORBIDDEN, array $headers = array())
Create a forbidden response
Response
redirect(string $to, int $code = Response::HTTP_MOVED_PERMANENTLY, array $headers = array())
Create a redirect response
Response
view(View $view, int $code = Response::HTTP_OK, array $headers = array())
Create a response from a view object
Response
controller(Controller $controller, int $code = Response::HTTP_OK, array $headers = array())
Create a response from a controller object
Response
collection(Collection $collection, int $code = Response::HTTP_OK, array $headers = array())
Create a response from a collection object