I don't think there's an option to limit the total number of records,
but you can achieve this quite easily by overiding the paginateCount
function in the model:
class Something extends AppModel {
// ...
function paginateCount($conditions, $recursive, $extra) {
$params = array_merge(compact('conditions', 'recursive'), $extra);
$count = $this->find('count', $params);
if ($count > 50) {
$count = 50;
}
return $count;
}
}
hth
grigri
On Nov 12, 10:15 am, snsanju <[EMAIL PROTECTED]> wrote:
> hi, I have 500 records or even more.
> on my home page i want to display only 10 records using pagination
>
> till here its fine. i am getting as expected. But my requirement is
> something different.
>
> I want only pagination for first 5 pages (means only for latest 50
> records i.e, 5x10 = 50). i mean only 5 maximum pages.
> is there any options in pagination function to limit the number of
> pages like limiting number of records.
> I feel, in one of previous version there was a option called maxpages
> (not sure).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---