[sheepish]
Posting a follow-up for any other clueless person looking for the
answer to this. I just took a closer look at next() and realised that
I can pass the limit param:

$paginator->next()
$paginator->next('next 20', array('url' => array('limit' => 20)))
$paginator->next('next 50', array('url' => array('limit' => 50)))

How simple is that?

On Wed, Jan 7, 2009 at 2:33 PM,  <[email protected]> wrote:
> I'm trying to figure out how to create pagination links which would change
> the limit used by the controller. Something like:
>
> prev 1 2 3 4 5 next | next 10 | next 20
>
> Looking through the source, nothing has jumped out at me. I know that I just
> need to append "limit:10" to the URL but how, then, do I get the *next*
> page?
>
> link() requires a Router-friendly URL. Far enough, but how to create it
> dynamically?
>
> $paginator->link('next 30', array(???), array('limit' => 30));
>
> The url() method will give back an array if the 2nd param ir true:
> $paginator->url(array('limit' => 50, 'page' => ?), true);
>
> But, again, how to specify the page? If I leave out the 'page' option, it
> defaults to "page:1".
>
> Surely, there must be a simple way to do this. If someone has a link to a
> good resource online, I'd very much appreciate it. I've been wading through
> all sorts of links to much more complicated pagination stuff and it's
> getting a bit depressing. Sometimes, it's the simplest things which are the
> most difficult to find.
>
> BTW, I realise that I can just set something up with javascript to append
> the limit to the href. In fact, the point of all this is to swap the links
> out withe a select list which does just that. However, I need to get
> something working that doesn't require scripting to be enabled, first.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to