Reputation: 331
I am trying to render a dynamically created xml data. Everything is working fine EXCEPT for some reason CodeIgniter adds unnecessary extra whitespace at the beginning of the document.
Here's what I have tried so far but with no luck:
just left the controller method empty.
public function whateverControllerMethod(){ // empty with no code }
Upvotes: 1
Views: 1390
Reputation: 11
Check if in the top of models or controllers there is whitespace or lines before of tag php, because sometimes if used the file autoload.php that is in the path application/config and load all models and if there is whitespace or lines before of tag php in the models then the output from the function of controller will be with extra whitespace.
In my case, this was my problem:
Upvotes: 1