function HeaderBag::get
Returns the first header by name or the default one.
1 call to HeaderBag::get()
- HeaderBag::getDate in vendor/
symfony/ http-foundation/ HeaderBag.php - Returns the HTTP header value converted to a date.
File
-
vendor/
symfony/ http-foundation/ HeaderBag.php, line 109
Class
- HeaderBag
- HeaderBag is a container for HTTP headers.
Namespace
Symfony\Component\HttpFoundationCode
public function get(string $key, ?string $default = null) : ?string {
$headers = $this->all($key);
if (!$headers) {
return $default;
}
if (null === $headers[0]) {
return null;
}
return $headers[0];
}