Sorry But I will get the pagination on the users In the view I must list all users that are in relation with Document with id=$id and I would ,if it is possible using the pagination for paginate the users.
On 6 Lug, 21:56, Miles J <[email protected]> wrote: > In the controller: > > var $paginate = array( > 'Document' => array( > 'fields' => array('Document.*'), > 'contain'=>array( > 'User'=>array( > 'fields' => array('User.id','User.surname','User.name'), > 'conditions' => array('User.active'=>1) > ) > ) > ) > ) > ); > > $paging = $this->paginate('Document', array('Document.id'=>$id)); > > On Jul 6, 7:37 am, "[email protected]" > > <[email protected]> wrote: > > Hi > > I have a containable model. > > I would apply the pagination on the results inside contain. > > Example: > > > Models : Document hasMany User > > > In documents_controller.php I have this: > > > $document=$this->Document->find('first', > > array( > > 'fields' => array('Document.*'), > > 'conditions' => array('Document.id'=>$id), > > 'contain'=>array( > > 'User'=>array( > > 'fields' => array('User.id','User.surname','User.name'), > > 'conditions' => array('User.active'=>1) > > ) > > ) > > ) > > ); > > > In the view I would get the pagination on the users. > > Is it possible to do this? > > How I set "paginate" to do this? > > Many Thanks > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
