PHP Freelancer

Set Page Title Syntax In CakePHP 1.3

04.27.2010 · Posted in CakePHP

Hello Friends, I have worked in CakePHP 1.2 some time ago and after long time I have started new CakePHP project and now CakePHP 1.3 available and CakePHP 1.3 having so many new features. So when I used CakePHP 1.3 for new project then I found that set page title syntax has been changed in CakePHP 1.3. In CakePHP 1.2 we can set page title value in controller given below

$this->pageTitle = "Page Title Value";

Remember that this pageTitle value worked if we used $title_for_layout variable in layout file. But now in cakePHP 1.3 setting of pageTitle syntax has been changed and new page title syntactic for cakePHP 1.3 is given below.

$this->set("title_for_layout","Page Title Value");

So this is the new and simple page title syntax for CakePHP 1.3  and now we want to print value of page title then your layout file must have $title_for_layout variable between <title> tag.

  • Supratux
    Muchas gracias ;)

    ==================

    Thank you ;)
  • lorro
    thanks for this ;)
    got little stuck, didn't understand why this simple thing didn't work
blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Thank you for using IGIT Tweet Share Button, a plugin by HackingEthics