Sets a single HTTP header.
Parameters
$key
stringrequired- Header name.
$value
stringrequired- Header value.
$replace
booloptional- Whether to replace an existing header of the same name.
Default:
true
Source
public function header( $key, $value, $replace = true ) {
if ( $replace ) {
unset( $this->response->headers[ $key ] );
}
$this->response->headers[ $key ] = $value;
}
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.