Set page title in CakePHP
I just noticed that several people are searching for a phrases like "cakephp home change page title" or "page title cakephp" and landing up here. I am sure they must be returning disappointed - so this is an quick tip for them
To set a page title in CakePHP in your controller write
-
$this->set('title', 'My Page Title');
or the less preferred and probably soon to be deprecated
-
$this->pageTitle = 'My Page Title'
However if you are using the pages controller to render a few static pages and want custom title, in your view (static page) use
-
$this->pageTitle = 'My page title';
Hope that helped
About this entry
You’re currently reading “ Set page title in CakePHP ,” an entry on SANIsoft - PHP for E Biz
- Published:
- 7.13.07 / 10am
- Author:
- Tarique Sani
2 Comments
Jump to comment form | comments rss | trackback uri