Saturday, January 5, 2013

Re: Pagination of another Model

public $uses = array('Event', 'Feeding');
public $paginate = array(
'Event' => array(
// ...
),
'Feeding' => array(
// ...
)
);

$this->paginate('Feeding');

On Sat, Jan 5, 2013 at 12:13 PM, Michael Gaiser <mjgaiser@gmail.com> wrote:
> So I trying to build an index page for my 'Event' controller, but this
> controller has been setup a little differently than my other ones. All of
> the events share the same "Event" model, except for the feeding events which
> for many reasons, have their own "Feeding" model. Both tables have a
> "Location" associated with them so for the most part I was able to gain
> access to this "Feeding" model by using "$this->Event->Location->Feeding".
> This has worked for the most part, but now that I am trying to make a
> paginate call from the Events index function, I am unsure how to set which
> model to use as it seems to default to the "Event" model. Anyone know how to
> have it list an index of the Feeding Model from the Events Index function?
> Thanks
>
> ~Michael
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate