ResponseListener::getSubscribedEvents()

static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: The method name to call (priority defaults to 0) An array composed of the method name to call and the priority An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: array('eventName' => 'methodName') array('eventName' => array('methodName', $priority)) a

ResponseHeaderBag::replace()

replace(array $headers = array()) Replaces the current HTTP headers by a new set. Parameters array $headers An array of HTTP headers

ResponseHeaderBag::setCookie()

setCookie(Cookie $cookie) Sets a cookie. Parameters Cookie $cookie

ResponseHeaderBag::removeCookie()

removeCookie(string $name, string $path = '/', string $domain = null) Removes a cookie from the array, but does not unset it in the browser. Parameters string $name string $path string $domain

ResponseHeaderBag::remove()

remove(string $key) Removes a header. Parameters string $key The HTTP header name

ResponseListener

class ResponseListener implements EventSubscriberInterface ResponseListener fixes the Response headers based on the Request. Methods __construct($charset) onKernelResponse(FilterResponseEvent $event) Filters the Response. static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. Details __construct($charset) Parameters $charset onKernelResponse(FilterRespo

ResponseHeaderBag::getCookies()

array getCookies(string $format = self::COOKIES_FLAT) Returns an array with all cookies. Parameters string $format Return Value array Exceptions InvalidArgumentException When the $format is invalid

ResponseHeaderBag::clearCookie()

clearCookie(string $name, string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true) Clears a cookie in the browser. Parameters string $name string $path string $domain bool $secure bool $httpOnly

ResponseHeaderBag::makeDisposition()

string makeDisposition(string $disposition, string $filename, string $filenameFallback = '') Generates a HTTP Content-Disposition field-value. Parameters string $disposition One of "inline" or "attachment" string $filename A unicode string 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 Return Value string A string suitable for use

ResponseHeaderBag::hasCacheControlDirective()

bool hasCacheControlDirective(string $key) Returns true if the Cache-Control directive is defined. Parameters string $key The Cache-Control directive Return Value bool true if the directive exists, false otherwise