It makes no sense for paginate to be called as-is in a model.

The `paginate` method is part of the controller, because it relies on
URL settings (which page, sort order, etc) which only the controller
can access. Allowing the model to access these parameters directly
would violate MVC - in a bad way.

What exactly are you trying to achieve in the model that can't be done
with a find('all')?

hth
grigri

On Jul 14, 12:23 pm, Shaz <shazam...@gmail.com> wrote:
> (Sorry I meant from my Controllers to my Models!)
>
> On 14 July, 12:12, Shaz <shazam...@gmail.com> wrote:
>
> > With my current craze of moving all logic from my models to my
> > controllers, a slight problem has risen - namely I can't seem to use
> > "$this->paginate()" in a Model function thats called in a controller.
>
> > $this->find() works perfectly find, and I'm trying to replace $this->find( 
> > 'all', $conditions ); with $this->paginate( 'Article',
>
> > $conditions ).
>
> > Any advice on either how to get $this->paginate working from a model,
> > or perhaps an elegant way of using find() to display my results on
> > separate pages?
>
>

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to