If you want to use the paginator, you have to use the paginate
function, not a naked find [well, you _could_, but it would be very
finnicky].
Try this:
class YourController extends AppController {
var $paginate = array(
'Rapportini' => array(
'recursive' => 0,
'limit' => 20 // or whatever
)
);
function index() {
$this->set('rapportinis', $this->paginate('Rapportini',
array('Rapportini.office_id' => $this->Auth->user('office_id'))
));
}
}
That should give you what you want.
hth
grigri
On Jan 20, 3:57 pm, tjr88 <[email protected]> wrote:
> Thats great :-)
>
> But i know get
> Undefined variable: paginator [APP\views\rapportinis\index.ctp, line
> 5]
>
> Fatal error: Call to a member function counter() on a non-object in C:
> \xampp\htdocs\projects\rapportini\app\views\rapportinis\index.ctp on
> line 5
>
> which is because i use paginator() on the index.cpt page. i tried to
> add the function like so,
> $this->set('rapportinis', $this->Rapportini->findAllByOfficeId($this-
>
> >Auth->user('office_id'),$this->paginate()));
>
> This only returns errors.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---