⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

isset($output->isJSONResponse) && $output->isJSONResponse



ninomorrone
  • profile picture
  • Member

Posted 28 June 2018 - 08:45 AM

Someone can explain me what means these rows in function _example_output($output = null) of CI demo Examples.php controller?
 
.. if (isset($output->isJSONResponse) && $output->isJSONResponse) {
            header('Content-Type: application/json; charset=utf-8');
            echo $output->output;
            exit; ..
public function _example_output($output = null)
{
if (isset($output->isJSONResponse) && $output->isJSONResponse) {
            header('Content-Type: application/json; charset=utf-8');
            echo $output->output;
            exit;
}
 
$this->load->view('example.php',(array)$output);
}

 

Very Thanks!