before you call $this->paginate('Post')
do this
$this->paginate = array('Post' => array('conditions => array('User.id' =>
$id)));
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2012/6/18 JonStark <[email protected]>
> Here is the function I use to display posts that have a User.id equal to
> $id :
>
> Code: php
>
> 1. $data = $this->paginate('Post', array <http://www.php.net/array>(
> 2. 'User.id' => $id,
> 3. )
> 4. );
> 5. $this->set('posts', $data)
>
> I have an array produced when researching user IDs matching certain
> criterias :
> Code: php
>
> 1. array <http://www.php.net/array>(
> 2. (int) 0 => '2',
> 3. (int) 1 => '4',
> 4. (int) 2 => '7' //etc
> 5. )
>
>
> Is there a way for cake to associate this array to $id,so that
> $this->paginate would display only posts whose ID is (in this exemple) 2, 4
> or 7 ?
>
> Thanks a lot !
>
> --
> 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