I have a model and i want to paginate its data. all i do is, creating a model, something like this,
class MyModel extends AppModel {}
and include Paginator component in my controller and use it, something like this,
class MyControllers extends AppController
{
public $components = array('Paginator');
public function index()
{
$this->paginate['MyModel'] = array('limit'=>5);
print_r($this->paginate('MyModel'));
}
}
And I have a table with my_controllers
name and it has 10 records. if everything was fine, the paginator component must give me 5 records for page one and 5 records for page 2. but it gives me 10 records without any paging.
What is the problem? :(
Thank you