Hi guys, I was reading about how to paginate, all this is applied to
the models (tables),  but for me isn't clear if I can paginate query
results. I'm trying to do this:

class MyModel extends AppModel {
...
function findAllItems($owner=null, $limit = 20, $page =1 ) { return
$this->query("SELECT ...."); }

}

and in the Controller:

class MyController extends AppController {
...
  function view($id = null) {
    ...
    $data = $this->MyModel->findAllItems($id)
    ...
  }
}

How I can paginate?,  I wrote something like this:

$this->set('myresutl', $this->paginate($data));

But that doesn't work.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to