On Jun 26, 2006, at 6:26 PM, BlenderStyle wrote:

>
>
> John David Anderson (_psychic_) wrote:
>> You might look at using an element or using requestAction to do that.
>
> I'm confused about how exactly requestAction works. Here's a  
> snippet of
> my DocsController:
>
> function getList()
> {
>   $this->set('doclist', $this->Doc->generateList(null, 'weight desc',
> null, '{n}.Doc.id', '{n}.Doc.name'));
> }

Mmm... you might want to be returning a value if you want only the  
data from this action.

I was actually thinking that you create the HTML that shows the list,  
and just use requestAction to grab the rendered list and pull it into  
the app controller.

So you have a view called get_list.thtml in your /app/views/docs/  
folder that shows the list, and you use

$this->requestAction('/docs/getList', array('return'));

in your layout file where you want the rendered doc list to be shown.


> Another thing that I'm totally confused about are elements. What does
> $this->element() and $this->renderElement() do?

Look it up in the API for a better idea of how it works.

> If I use
> $this->renderElement('doclist') in layouts/default.thml what needs to
> be in views/elements/doclist.thtml?

The HTML you want rendered where you call renderElement().

-- John

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to