I believe that for this code I can set an exact number of results per page on my page public $paginate = array('limit' => 7,);
Except that the results do not follow this number and they end up coming random.
Should I tinker somewhere else?
I believe that for this code I can set an exact number of results per page on my page public $paginate = array('limit' => 7,);
Except that the results do not follow this number and they end up coming random.
Should I tinker somewhere else?
I think that's how you're doing.
Examples:
CakePHP 3:
class ArticlesController extends AppController
{
public $paginate = [
'limit' => 25,
'order' => [
'Articles.title' => 'asc'
]
];
public function initialize()
{
parent::initialize();
$this->loadComponent('Paginator');
}
}
CakePHP 2:
class PostsController extends AppController {
public $components = array('Paginator');
public $paginate = array(
'limit' => 25,
'order' => array(
'Post.title' => 'asc'
)
);
}
But look for the CakePHP documentation. They always explain very well how its components work:
Documentation: