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

Breadcrumb

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

function HeaderBag::all

Returns the headers.

Parameters

string|null $key The name of the headers to return or null to get them all:

Return value

($key is null ? array<string, list<string|null>> : list<string|null>)

7 calls to HeaderBag::all()
HeaderBag::contains in vendor/symfony/http-foundation/HeaderBag.php
Returns true if the given HTTP header contains the given value.
HeaderBag::get in vendor/symfony/http-foundation/HeaderBag.php
Returns the first header by name or the default one.
HeaderBag::has in vendor/symfony/http-foundation/HeaderBag.php
Returns true if the HTTP header is defined.
HeaderBag::keys in vendor/symfony/http-foundation/HeaderBag.php
Returns the parameter keys.
HeaderBag::__toString in vendor/symfony/http-foundation/HeaderBag.php
Returns the headers as a string.

... See full list

1 method overrides HeaderBag::all()
ResponseHeaderBag::all in vendor/symfony/http-foundation/ResponseHeaderBag.php
Returns the headers.

File

vendor/symfony/http-foundation/HeaderBag.php, line 68

Class

HeaderBag
HeaderBag is a container for HTTP headers.

Namespace

Symfony\Component\HttpFoundation

Code

public function all(?string $key = null) : array {
    if (null !== $key) {
        return $this->headers[strtr($key, self::UPPER, self::LOWER)] ?? [];
    }
    return $this->headers;
}

API Navigation

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