Hi,
What I made to achieve the page numbers was simpler than to hack the
core, as Nate explained in another one thread.
==== in the view (list.ctp) ===
<?php
$params = $paginator->params();
echo $paginator->prev('<< Prev');
echo '<ul>';
for ($i = 1; $i <= $params['pageCount']; $i++) {
if ($i == $params['page']) {
echo '<li><strong>'.$i.'</strong></li>';
} else {
echo '<li>'.$paginator->link($i, array('page'
=> $i)).'</li>';
}
}
echo '</ul>';
echo $paginator->next('Next >>');
?>
I only added the UL and LI itens for the numbers, that I think to be
more semantic than EM.
But to achieve the the link to the first or last page i do not know
what to do.
Perhaps this gives you another idea.
T+
On Apr 12, 9:37 am, "francky06l" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am upgrading an application to cake 1.2 and needed to convert to the
> new paginator.
> I have amended the paginator helper to include :
>
> pageNumber : to get the number of pages
> hasFirst: to display an eventual First link
> hasLast: to display an eventual Last link
>
> For this I needed to modify slightly the _paginLink method (only
> little, because it always takes the current page + step ..etc ..)
>
> I also have added '<em></em.>' in the paginator's numbers function in
> order to make easier to apply a style on the current page (which is
> not a link)..
>
> I do not know if this modifications should be shared (maybe someone
> better than me can check the code), I can post the code here if that
> helps someone ..
> I also have done a Component to work with the paginate in controller,
> in order to save the conditions in sessions and be able to do a "back
> to list", when the list have been replaced by an edit view .. but I am
> sure it does not handle all cases (sort etc ...).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---