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

Breadcrumb

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

function HtmlResponse::__construct

Constructs a HtmlResponse object.

Parameters

array|string $content: The response content, see setContent().

int $status: The response status code.

array $headers: An array of response headers.

Throws

\InvalidArgumentException When the HTTP status code is not valid.

Overrides Response::__construct

2 calls to HtmlResponse::__construct()
BigPipeResponse::__construct in core/modules/big_pipe/src/Render/BigPipeResponse.php
Constructs a new BigPipeResponse.
BigPipeResponse::__construct in core/modules/big_pipe/src/Render/BigPipeResponse.php
Constructs a new BigPipeResponse.
1 method overrides HtmlResponse::__construct()
BigPipeResponse::__construct in core/modules/big_pipe/src/Render/BigPipeResponse.php
Constructs a new BigPipeResponse.

File

core/lib/Drupal/Core/Render/HtmlResponse.php, line 41

Class

HtmlResponse
Response that contains and can expose cacheability metadata and attachments.

Namespace

Drupal\Core\Render

Code

public function __construct($content = '', int $status = 200, array $headers = []) {
    parent::__construct('', $status, $headers);
    $this->setContent($content);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal