Re: Paginator issue
Thanks Andras, but I'm afraid that did not work. The conditions are
still not being applied. I might dig into the Cake core to see if I
can see where this might be failing.
Best,
-Brian
On Dec 12, 3:45 pm, Andras Kende <and...@kende.com> wrote:
> Brian,
>
> Try this way:
>
> $this->paginate = array(
> 'recursive' => 0,
> 'conditions' => array('Article.reporter_id' => 1)
> );
>
> > $this->set('articles', $this->paginate());
>
> Andras Kende
>
> On Dec 12, 2011, at 1:15 PM, aries wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I'm trying to directly modify the $paginate property within a
> > controller action but doing so is not having any effect on the find
> > operation. ArticleController has:
>
> > public $paginate = array();
>
> > public function reporter_index() {
> > $this->paginate['conditions'] = array('Article.reporter_id' => 1);
> > $this->Article->recursive = 0;
> > $this->set('articles', $this->paginate());
> > }
>
> > But the call to paginate() in this case returns all articles, ignoring
> > the conditions I set above it. However, if I call paginate() this way,
> > it works:
>
> > $this->set('articles', $this->paginate('Article',
> > array('Article.reporter_id' => 1)));
>
> > In Cake 1.3 the first method worked fine and according to the 2.0 docs
> > it appears to still be a valid way of setting pagination variables. Am
> > I missing something here?
>
> > Thanks much,
> > -Brian
>
> > --
> > Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home