CI_Output::set_header()

set_header($header[, $replace = TRUE])

Parameters:
  • $header (string) – HTTP response header
  • $replace (bool) – Whether to replace the old header value, if it is already set
Returns:

CI_Output instance (method chaining)

Return type:

CI_Output

Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

$this->output->set_header('HTTP/1.0 200 OK');
$this->output->set_header('HTTP/1.1 200 OK');
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
$this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
$this->output->set_header('Cache-Control: post-check=0, pre-check=0');
$this->output->set_header('Pragma: no-cache');
doc_CodeIgniter
2016-10-15 16:31:48
Comments
Leave a Comment

Please login to continue.