set_content_type() публичный Метод

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)
Результат CI_Output
Пример #1
0
 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']));
         }
     }
 }
Пример #2
0
 protected function htmlResponse($html)
 {
     return $this->output->set_content_type('text/html')->set_output($html);
 }