Thursday , 21 August 2014
Home » PHP Framework » CakePHP » Set Meta Title (Page Title) in CakePHP 1.2/1.3
Set Meta Title (Page Title) in CakePHP 1.2/1.3

Set Meta Title (Page Title) in CakePHP 1.2/1.3

Hello Friends,

As i mention in my previous posts, CakePHP 1.3 come up with lots of new syntax changes. I was looking for a Meta Title SEO tag for each page. I need to set this Meta Title (Page Title) for each page. You must be aware that Page Title can be set in method which we write in respective controller. Look at below syntax changes in CakePHP 1.2 and CakePHP 1.3 for setting Page Title.

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

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

If you find any problem in this than let me know by comment.

About Rakshit Patel

I am PHP Freelancer, Rakshit Patel AKA WordPress Freelancer working as PHP Programmer India. I am here to share all my developing knowledge, quick coding techniques, quick solutions to save your time and help you guys for any issue or bug fixing. If you have any PHP, WordPress, Magento related work, please contact me. I am interested for the work.

6 comments

  1. Pls tell me where to set page title. I am new to CaKePHP. visit my site and tell in which file I have to open and edit in my website.

  2. Pls tell me where to set page title. I am new to CaKePHP. visit my site and tell in which file I have to open and edit in my website.

  3. @GMAmin2010 , you can set this meta title for each page in particular method in your controller. Whatever you set in controller, you can show it in page layout.

  4. @GMAmin2010 , you can set this meta title for each page in particular method in your controller. Whatever you set in controller, you can show it in page layout.

  5. in controller using like dat
    pageTitle = ‘Add New Record’;
    /*
    some process to do;
    */
    }

    ?>

  6. in controller using like dat
    pageTitle = ‘Add New Record’;
    /*
    some process to do;
    */
    }

    ?>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>