public function HeaderBag::has

Returns true if the HTTP header is defined.

@api

Parameters

string $key The HTTP header:

Return value

Boolean true if the parameter exists, false otherwise

1 call to HeaderBag::has()
ResponseHeaderBag::computeCacheControlValue in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/ResponseHeaderBag.php
Returns the calculated value of the cache-control header.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/HeaderBag.php, line 182

Class

HeaderBag
HeaderBag is a container for HTTP headers.

Namespace

Symfony\Component\HttpFoundation

Code

public function has($key) {
  return array_key_exists(strtr(strtolower($key), '_', '-'), $this->headers);
}