You can do this at the top of the file in PHP code. This way you do not have to modify the pages_controller.php unless you really want to.
So in your file /app/views/pages/my_static_page.thtml
Put this line at the top of the file and change the value to whatever you want.
<?php $this->pageTitle = 'New Title For Static Page'; ?>
Then when you load example.com/pages/my_static_page
You will get your new title instead of the default. I did this with my resume.thtml file to display "Résumé" instead of "Resume".
But if you are modifying the pages_controller already there may be fancier things you are trying to do.
On 7/28/06, Sergei <[EMAIL PROTECTED]> wrote:
Hi,
if you need to set custom titles for static pages, here's a solution:
1. just copy pages_controller.php to your app/controllers dir.
2. make an array after line
var $uses = null;
...
like this:
var $titles = array (
'help' => 'Ваша помощь',
'faq' => 'Вопросы и ответы',
'agreement' => 'Соглашение',
'your_view_name' => 'your_page_title',
);
3. change this line
96. $title = ucfirst($path[$count - 1]);
to this:
96. $title = $this->titles[$path[$count - 1]];
That's it.
S.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---
- PagesController and titles Sergei
- Re: PagesController and titles John Zimmerman [gmail]
- Re: PagesController and titles Sergei
- Re: PagesController and titles John Zimmerman [gmail]
