Wikimedia SlimApp
Common classes to help with creating an application using the Slim micro framework and Twig template engine.
Loading...
Searching...
No Matches
Wikimedia\Slimapp\HeaderMiddleware Class Reference

Middleware to add headers to the response. More...

+ Inheritance diagram for Wikimedia\Slimapp\HeaderMiddleware:
+ Collaboration diagram for Wikimedia\Slimapp\HeaderMiddleware:

Public Member Functions

 __construct (array $headers=[])
 
 call ()
 Add configured headers to response.
 

Protected Attributes

 $headers
 

Detailed Description

Middleware to add headers to the response.

Allows arbitrary headers to be added to each response.

Author
Bryan Davis bd808.nosp@m.@wik.nosp@m.imedi.nosp@m.a.or.nosp@m.g

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Slimapp\HeaderMiddleware::__construct ( array $headers = [])
Parameters
array$headersCollection of headers to set. Array keys are header names and values are either header values or callables that will return header values. Callables will be passed the current Slim application as the sole argument and must return either a string value to use as the header content or null to cancel setting this header.

The documentation for this class was generated from the following file: