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 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
> [email protected] For more options, visit this group at 
> http://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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to