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!

  • Google

    Google

    Very couple of web-sites that come about to be detailed below, from our point of view are undoubtedly very well worth checking out.

  • gossips

    gossips

    […]Here are a few of the internet sites we suggest for our visitors[…]

  • jimmy choo

    jimmy choo

    […]the time to read or visit the content or internet sites we have linked to beneath the[…]

  • dolce and gabbana

    dolce and gabbana

    […]just beneath, are numerous entirely not connected websites to ours, having said that, they’re surely worth going over[…]

  • 60141

    60141

    […]we prefer to honor many other internet sites on the web, even when they aren’t linked to us, by linking to them. Beneath are some webpages really worth checking out[…]

  • vader streams apk

    vader streams apk

    […]below you will come across the link to some web pages that we think you must visit[…]

  • kakie byvajut familii

    kakie byvajut familii

    […]check beneath, are some completely unrelated internet websites to ours, having said that, they’re most trustworthy sources that we use[…]

  • voyance par téléphone

    voyance par téléphone

    […]Wonderful story, reckoned we could combine a few unrelated data, nonetheless seriously really worth taking a appear, whoa did a single learn about Mid East has got more problerms at the same time […]

  • vibrators for women

    vibrators for women

    […]we came across a cool website which you may possibly delight in. Take a look for those who want[…]

  • Recarga de Extintores

    Recarga de Extintores

    […]always a large fan of linking to bloggers that I enjoy but do not get a great deal of link like from[…]

  • mp3

    mp3

    […]here are some hyperlinks to web pages that we link to mainly because we consider they may be worth visiting[…]

  • 11 inches whopper dong

    11 inches whopper dong

    […]Here is a superb Weblog You may Obtain Interesting that we Encourage You[…]

  • Garo Kassabian

    Garo Kassabian

    […]one of our guests recently recommended the following website[…]

  • burberry

    burberry

    […]Sites of interest we’ve a link to[…]

  • DIY

    DIY

    […]here are some hyperlinks to websites that we link to due to the fact we assume they may be really worth visiting[…]

  • versace

    versace

    […]here are some hyperlinks to web-sites that we link to since we think they may be really worth visiting[…]

Bake a comment




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

© daniel hofstetter. Licensed under a Creative Commons License