Hi,
If you want to use $description_for_layout as same as $title_for_layout,
you have to extends View class(cake/libs/view/view.php). You can find
the mechanism of $title_for_layout in View::renderLayout().
However I do not want to modify the file in cake directory. I often
extends AppController for this purpose.
1. copy cake/app_controller.php to app/app_controller.php
2. add a variable named $pageDescription in AppController
3. override beforeRender() and put the line below:
$this->set('description_for_layout', $this->pageDescription);
This works fine for me.
If you override beforeRender() in other controllers which extends
AppController, do not forget call the AppController's beforeRender().
Best Wishes,
Takuo Shiono
vdvm wrote:
> Hi,
>
> In a controller you can use $this->pageTitle wich corresponds with
> $title_for_layout in your layout.
> I would like to create $description_for_layout and use it as $this-
>> pageDescription in my controller.
> How can i create this?
>
> Thank you!
>
> >
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---