Displaying Category: Cakephp

Rogue lines in CakePHP

So you're using CakePHP and you're looking at the HTML (or RSS or whatever else) source that's being returned and you see a rogue line (CR/LF) as the first line in the source. You look through all of your templates and can't find anything obviously outputting this blank line... What could it be?

Try looking in your routes.php file. I found that two blank lines at the end of the routes.php file will, for whatever reason, output a blank line at the top of everything that CakePHP outputs.

The reason this is especially bad is because, in the case of RSS at least, a blank line will invalidate the XML content so it doesn't look like a feed to a feed reader.
Comment on this Article Anonymously

Please note: Comments posted anonymously will be submitted for moderation. Your email address will not be posted.

Allowed tags: <p>, <strong>, <em>, <img>, <a>, <blockquote>, <pre>, <code>, <ul>

expand
Posted my review of Tinker, Tailor, Soldier, Spy http://t.co/m6jrLleH This movie is smarter than I am.
2 days, 10 hours ago
My review of Underworld: Awakening has been posted. http://t.co/FX3FQZQk #skintightpantsandcorsets
3 days, 16 hours ago
And there it is, folks, the reason I don't talk to girls. http://t.co/fH1cM1Ud
1 week, 1 day ago
@alibakes Haywire is a sparse little covert thriller featuring a smooth jazz score. I can't think of anything else to say about it.
1 week, 1 day ago
Posted my review of Red Tails: http://t.co/8mZVuHuB
2 weeks, 2 days ago
Posted my review of Haywire: http://t.co/CJnTo32w
2 weeks, 2 days ago
@dcorsetto I would also like to contribute to the "Anti-Humans in Traffic" fundraiser. #pleasemakeitstop
2 weeks, 4 days ago
@kumailn Funny, at first I thought you were referring to the now defunct game studio.
2 weeks, 4 days ago
Watching the world rise up to protest oppressive stupidity: #sopa #pipa
2 weeks, 6 days ago
My incredibly short review of Mission Impossible: Ghost Protocol http://t.co/SwXymQKQ
3 weeks, 2 days ago
@Nanalew Why yes, I am going to be there! As soon as I can extract myself from the office... #harderthanitsounds
3 weeks, 4 days ago
@nerdist @930Club @EllenMcLain @johnpatricklowr Thank you all for a wonderful show last night! My nerd brain is basking in the afterglow.
on 7/1/12
I saw The Girl with the Dragon Tattoo yesterday. http://t.co/NgKSuCQA
on 3/1/12
Happy birthday to the Spacey One!
on 1/1/12
Now commencing my 37th year of post-womb life.
on 31/12/11
@dcorsetto For the record, I'm more grossed out by pooping. And war. War and pooping, mostly.
on 30/12/11
@wired I only use Gmail to manage my Contacts. Today was the first time I had seen the new interface. I couldn't find the Contacts.
on 28/12/11
@jessiechar The scary thing is, most hipsters don't know they're hipsters.// How ironic.
on 21/12/11
Twitter ran out of "who to follow" recommendations for me. I should probably turn the Internet off now.
on 19/12/11
This happened again: http://t.co/YpiuEWfn
on 19/12/11