Mecha CMS

Lot::set()

Set or get response headers.

2.2.0 Static

Lot::set(string $key);
Lot::set(string $key, $value = null);
Lot::set(array $keys);

Example:

// Set `content-type` value for the response
Lot::set('content-type', 'text/plain');

// Set `content-length` and `content-type` value for the response
Lot::set([
    'content-length' => 0,
    'content-type' => 'text/plain'
]);

// Get `content-type` value that has been set previously
echo Lot::set('content-type');