pageTitle gotcha

11 Jul 2010 - webdev cakephp

When cake moved from 1.2 to 1.3, there were a few changes. While the manual is up-to-date, the default manual that’s shown tends to be 1.2 and there is a section in the 1.2 manual that talks about the migration. I got stuck with one of the gotchas today. I spent 1 hour trying to find out why the title I set in $pageTitle would not print with $title_for_layout until Phally pointed it out on IRC for me. To set the title from the controller, I’m supposed to this

    $this->set ('title*for*layout', 'My title');

Doh! Anyway, now I’ve changed my bookmark to the 1.3 manual instead of 1.2

For a full list of changes, take a look at the transition guide.