How to get rid of “CakePHP: the PHP Rapid Development Framework” at the top of your pages

Published on and tagged with cakephp  faq  layout

An often asked newbie question in the IRC channel is: How can I get rid of “CakePHP: the PHP Rapid Development Framework” at the top of my pages?

This header is shown because you don’t have defined your own layout yet, and so the default layout is used which comes with CakePHP (located in /cake/libs/view/layouts/default.ctp /cake/libs/view/templates/layouts/default.ctp (respectively .thtml with CakePHP 1.1)). Now the first idea is to edit this file. That would work. But it violates the golden rule of CakePHP: Don’t edit files in the cake folder! So, instead you have to copy the file to /app/views/layouts. Then you can edit the layout in any way you want.

Happy baking :)

Update 2009-05-29: Fixed path to layout because it has changed since this article has been written. Thanks to Göran K. for the hint!

8 comments baked

  • Dieter@be

    lol @ google ads :-)

  • jiri

    Another hot tip for Cake newbies: read the manual! ;)

    “Cake’s default layout can be overridden by placing a new default layout at /app/views/layouts/default.thtml.”

  • cakebaker

    @Dieter: Yeah, sometimes the Google algorithms are not that good in providing related ads ;-)

    @jiri: Thanks for the additional tip :)

  • Brendon Kozlowski

    Good deal, thanks!

    I’ve read through the manual entirely, but without actually applying it during the reading process to something concrete, a lot of the information squeezed out of that mass between my ears. Extra reminders are always helpful (especially since I should be starting my first CakePHP project very soon).

  • cakebaker

    @Brendon: Yes, only reading the manual is probably not that efficient ;-) Learning by doing is imho more efficient, so I can only recommend to start your own CakePHP project. Good luck!

  • Brendon Kozlowski

    Definitely not efficient at all. But, it still gives me a decent background or simple understanding of the features and syntax. Even better, I have a good idea of where I need to look in the manual to find an answer to something (at least, that’s the plan).

    Still, tips are always great. Thanks, Dan! ;)

  • Göran K

    I think you specified the path incorrectly.

    In my CakePHP 1.2.* installations there is no cake/libs/view/templates/layouts directory.

    The default.ctp is found at cake/libs/view/layouts/default.ctp

  • cakebaker

    @Göran: You are right, the path has changed since I have written this article. I changed it in the article. Thanks for the hint!

Bake a comment




(for code please use <code>...</code> [no escaping necessary])

© daniel hofstetter. Licensed under a Creative Commons License