You are here

public static function Response::create in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\Response::create()

Factory method for chainability.

Example:

return Response::create($body, 200) ->setSharedMaxAge(300);

Parameters

mixed $content The response content, see setContent():

int $status The response status code:

array $headers An array of response headers:

Return value

Response

1 call to Response::create()
ResponseTest::testCreate in vendor/symfony/http-foundation/Tests/ResponseTest.php
4 methods override Response::create()
BinaryFileResponse::create in vendor/symfony/http-foundation/BinaryFileResponse.php
JsonResponse::create in vendor/symfony/http-foundation/JsonResponse.php
Factory method for chainability.
RedirectResponse::create in vendor/symfony/http-foundation/RedirectResponse.php
Factory method for chainability.
StreamedResponse::create in vendor/symfony/http-foundation/StreamedResponse.php
Factory method for chainability.

File

vendor/symfony/http-foundation/Response.php, line 220

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public static function create($content = '', $status = 200, $headers = array()) {
  return new static($content, $status, $headers);
}