Set Content-Type Header
public set_content_type ( string $mime_type, string $charset = NULL ) : CI_Output | ||
$mime_type | string | Extension of the file we're outputting |
$charset | string | Character set (default: NULL) |
Résultat | CI_Output |
private function processResponseData(array $response) { if (!$this->input->is_ajax_request()) { redirect('/'); } $this->output->set_content_type('application/json'); if ($response['code'] == 200) { if ($response['data']['success']) { $this->output->set_output(json_encode($response['data']['data'])); } } }
protected function htmlResponse($html) { return $this->output->set_content_type('text/html')->set_output($html); }