set_content_type($mime_type[, $charset = NULL])
Parameters:
$mime_type (string) – MIME Type idenitifer string
$charset (string) – Character set Returns:
CI_Output instance (method chaining) Return type:
CI_Output
Permits you to set the mime-type of your page so you can serve JSON data, JPEG’s, XML, etc easily.
$this->output
->set_content_type('application/json')
->set_output(json_encode(array('foo' => 'bar')));
$this->output
->set_content_