Sunday, April 4, 2010

Re: Default Layout and Controller

On Apr 3, 5:00 pm, Alejandro <alejandroflor...@gmail.com> wrote:
> Hello,
>
> This is my first message and I'm practically new on CakePHP. I have
> this doubt. In my default layout I have a selection box that's filled
> with data from the database, but how can I have access to the database
> if there's no controller associated to the default layout.

Use an element. Inside the element, use $this->requestAction(...). In
the layout, use, eg. echo $this->element(''path/to/element',
array('cache' => '+1 week'));

Search for "cakephp element cache" online for more info.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.

No comments: