public static function Response::create

Factory method for chainability

Example:

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

Parameters

string $content The response content:

integer $status The response status code:

array $headers An array of response headers:

Return value

Response

1 call to Response::create()
ResponseTest::testCreate in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
3 methods override Response::create()
JsonResponse::create in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.php
Factory method for chainability
RedirectResponse::create in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/RedirectResponse.php
Factory method for chainability
StreamedResponse::create in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/StreamedResponse.php
Factory method for chainability

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php, line 161

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);
}