Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • AcceptHeader
  • AcceptHeaderItem
  • ApacheRequest
  • BinaryFileResponse
  • Cookie
  • ExpressionRequestMatcher
  • FileBag
  • HeaderBag
  • IpUtils
  • JsonResponse
  • ParameterBag
  • RedirectResponse
  • Request
  • RequestMatcher
  • RequestStack
  • Response
  • ResponseHeaderBag
  • ServerBag
  • StreamedResponse

Interfaces

  • RequestMatcherInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class ResponseHeaderBag

ResponseHeaderBag is a container for Response HTTP headers.

Symfony\Component\HttpFoundation\HeaderBag implements IteratorAggregate, Countable
Extended by Symfony\Component\HttpFoundation\ResponseHeaderBag
Namespace: Symfony\Component\HttpFoundation
Author: Fabien Potencier fabien@symfony.com
Api
Located at ResponseHeaderBag.php
Methods summary
public
# __construct( array $headers = array() )

Constructor.

Constructor.

Parameters

$headers
An array of HTTP headers

Api

Overrides

Symfony\Component\HttpFoundation\HeaderBag::__construct()
public string
# __toString( )

Returns the headers as a string.

Returns the headers as a string.

Returns

string
The headers

Overrides

Symfony\Component\HttpFoundation\HeaderBag::__toString()
public array
# allPreserveCase( )

Returns the headers, with original capitalizations.

Returns the headers, with original capitalizations.

Returns

array
An array of headers
public
# replace( array $headers = array() )

Replaces the current HTTP headers by a new set.

Replaces the current HTTP headers by a new set.

Parameters

$headers
An array of HTTP headers

Api

Overrides

Symfony\Component\HttpFoundation\HeaderBag::replace()
public
# set( string $key, string|array $values, boolean $replace = true )

Sets a header by name.

Sets a header by name.

Parameters

$key
The key
$values
The value or an array of values
$replace
Whether to replace the actual value or not (true by default)

Api

Overrides

Symfony\Component\HttpFoundation\HeaderBag::set()
public
# remove( string $key )

Removes a header.

Removes a header.

Parameters

$key
The HTTP header name

Api

Overrides

Symfony\Component\HttpFoundation\HeaderBag::remove()
public boolean
# hasCacheControlDirective( string $key )

Returns true if the Cache-Control directive is defined.

Returns true if the Cache-Control directive is defined.

Parameters

$key
The Cache-Control directive

Returns

boolean
true if the directive exists, false otherwise

Overrides

Symfony\Component\HttpFoundation\HeaderBag::hasCacheControlDirective()
public mixed|null
# getCacheControlDirective( string $key )

Returns a Cache-Control directive value by name.

Returns a Cache-Control directive value by name.

Parameters

$key
The directive name

Returns

mixed|null
The directive value if defined, null otherwise

Overrides

Symfony\Component\HttpFoundation\HeaderBag::getCacheControlDirective()
public
# setCookie( Symfony\Component\HttpFoundation\Cookie $cookie )

Sets a cookie.

Sets a cookie.

Parameters

$cookie

Api

public
# removeCookie( string $name, string $path = '/', string $domain = null )

Removes a cookie from the array, but does not unset it in the browser.

Removes a cookie from the array, but does not unset it in the browser.

Parameters

$name
$path
$domain

Api

public array
# getCookies( string $format = Symfony\Component\HttpFoundation\ResponseHeaderBag::COOKIES_FLAT )

Returns an array with all cookies.

Returns an array with all cookies.

Parameters

$format

Returns

array

Throws

InvalidArgumentException
When the $format is invalid

Api

public
# clearCookie( string $name, string $path = '/', string $domain = null, boolean $secure = false, boolean $httpOnly = true )

Clears a cookie in the browser.

Clears a cookie in the browser.

Parameters

$name
$path
$domain
$secure
$httpOnly

Api

public string
# makeDisposition( string $disposition, string $filename, string $filenameFallback = '' )

Generates a HTTP Content-Disposition field-value.

Generates a HTTP Content-Disposition field-value.

Parameters

$disposition
One of "inline" or "attachment"
$filename
A unicode string
$filenameFallback

A string containing only ASCII characters that is semantically equivalent to $filename. If the filename is already ASCII, it can be omitted, or just copied from $filename

Returns

string
A string suitable for use as a Content-Disposition field-value.

Throws

InvalidArgumentException

See

RFC 6266
protected string
# computeCacheControlValue( )

Returns the calculated value of the cache-control header.

Returns the calculated value of the cache-control header.

This considers several other headers and calculates or modifies the cache-control header to a sensible, conservative value.

Returns

string
Methods inherited from Symfony\Component\HttpFoundation\HeaderBag
add(), addCacheControlDirective(), all(), contains(), count(), get(), getCacheControlHeader(), getDate(), getIterator(), has(), keys(), parseCacheControl(), removeCacheControlDirective()
Constants summary
string COOKIES_FLAT
# 'flat'
string COOKIES_ARRAY
# 'array'
string DISPOSITION_ATTACHMENT
# 'attachment'
string DISPOSITION_INLINE
# 'inline'
Properties summary
protected array $computedCacheControl
# array()
protected array $cookies
# array()
protected array $headerNames
# array()
Properties inherited from Symfony\Component\HttpFoundation\HeaderBag
$cacheControl, $headers
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen