set_content_type() Doesn't seem to be working? |
Yes, you need to use a view, OR use set_output() because of the way CI buffers output. If you echo from a controller, that happens before anything else since the controller has to complete before CI will send IT's data out. And using output->set_content_type() is part of that, which is why it doesn't work the way you wrote it and using native PHP header() does.
A workaround is to finish what you started and send your output using output->set_output() http://www.codeigniter.com/user_guide/li...set_output $this->output->set_output($partition); //instead of echo $partition |
Messages In This Thread |
set_content_type() Doesn't seem to be working? - by jLinux - 07-05-2015, 04:05 PM
RE: set_content_type() Doesn't seem to be working? - by Avenirer - 07-06-2015, 04:01 AM
RE: set_content_type() Doesn't seem to be working? - by CroNiX - 07-06-2015, 11:04 AM
RE: set_content_type() Doesn't seem to be working? - by jLinux - 07-11-2015, 03:46 PM
|