Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Response.php

function Response::setContent

Sets the response content.

Return value

$this

7 calls to Response::setContent()
HtmlResponse::setContent in core/lib/Drupal/Core/Render/HtmlResponse.php
Sets the response content.
HtmlResponse::setContent in core/lib/Drupal/Core/Render/HtmlResponse.php
Sets the response content.
JsonResponse::update in vendor/symfony/http-foundation/JsonResponse.php
Updates the content and headers according to the JSON data and callback.
RedirectResponse::setTargetUrl in vendor/symfony/http-foundation/RedirectResponse.php
Sets the redirect target of this response.
Response::prepare in vendor/symfony/http-foundation/Response.php
Prepares the Response before it is sent to the client.

... See full list

3 methods override Response::setContent()
BinaryFileResponse::setContent in vendor/symfony/http-foundation/BinaryFileResponse.php
HtmlResponse::setContent in core/lib/Drupal/Core/Render/HtmlResponse.php
Sets the response content.
StreamedResponse::setContent in vendor/symfony/http-foundation/StreamedResponse.php

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setContent(?string $content) : static {
    $this->content = $content ?? '';
    return $this;
}
RSS feed
Powered by Drupal