CodeIgniter Forums
Cannot modify header information error in CI with Smarty - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Cannot modify header information error in CI with Smarty (/showthread.php?tid=3544)



Cannot modify header information error in CI with Smarty - El Forum - 10-09-2007

[eluser]Myles Wakeham[/eluser]
I'm implementing NuSOAP in a CI app that also uses Smarty. I can call the WSDL without any problem and get the XML data sent from it fine if I call a PHP file directly from the root directory of the application.

But when I attempt to do this through a /index.php/..... structure, and have my NuSOAP calls through the CI controllers, I get the following error:

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/cyberears.com/htdocs/ci_content/application/libraries/MySmarty.php:39)

Filename: libraries/nusoap.php

Line Number: 3281

There is no Smarty template being sent to the browser at all for this - just XML for the WSDL.

Is there a simple way to ensure that the output from CI doesn't go through the Smarty engine even if Smarty is installed as a library?

Myles


Cannot modify header information error in CI with Smarty - El Forum - 10-09-2007

[eluser]Michael Wales[/eluser]
If I remember correctly there is a whitespace at the end of the Smarty library...

That's the issue though, whether it's in the Smarty library or not, you have a whitespace somewhere that needs to be taken care of.


Cannot modify header information error in CI with Smarty - El Forum - 10-09-2007

[eluser]Myles Wakeham[/eluser]
Bingo! You were right. I found the problem in one of the libraries, and removed the whitespace. Now all works as it should.

Thanks again.

Myles