> I have 2 models Venue and Event. I want to do a search page that returns
> both Venue and Event on 1 page and trying to get the ajax pagination feature
> in cake rc2 to work.

My advice is: Get it working without ajax, then add ajax.

> However, the first parameter for $this->paginate(...) is the 'type' (model).
> Is it possible for my controller to have both $this->paginate ('Venue',...)
> and $this->paginate ('Event',...) at the same time?

Not at the moment, but there are a few of open tickets related to this
in http://trac.cakephp.org.

You can call $this->paginate('Model1') and $this->paginate('Model2'),
but links generated retain parameters only for one model.

> Or, it would be preferable to do a custom query and feed the results of this
> query to the paginate() function. Is this possible?

Well, that depends on how the models are related.

If you think the only way to go is a custom query, there are many
threads in this group, Chris's blog, the Cookbook

http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/
http://book.cakephp.org/view/249/custom-query-pagination

> Any other possible ways to do this?

This is just an idea, but if you are searching and wan't to get the
results from both (unrelated) models, you can define a tableless
model, with fake relations to both models in order to gain instances
of the models. Then create the paginate() and paginateCount() methods
needed for custom pagination and do your business with both models
there.

Remember that if your models are related, it's easier to get
paginate() to do the work.

> Thanks
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to