Nice, now the links actually are clickable and route to the correct
pagination view. But the link still looks like this:

http://localhost/test/newyorkcity/spots/newyorkcity/page:2

So using the options() in the paginationhelper is passing it twice to the
controller? If I *don't* use the options, however, the location is only
passed once through the url formatting but the links are no longer
clickable.

For reference, here are my changes as suggested by Mathew:

<?php $paginator->options(array('url' => array('location' =>
$this->params['location']))); ?>

Router::connect('/:location/spots/*', array('controller' => 'spots',
'action' => 'index'), array('pass' => array('location'), 'location' =>
'[a-z]+'));


On Sun, Oct 19, 2008 at 8:48 AM, Mathew <[EMAIL PROTECTED]> wrote:

>
> > Router::connect('/:location/spots/:page', array('controller' =>
> > 'spots', 'action' => 'index'), array('pass' => array('location'),
> > 'location' => '[a-z]+'));
>
> Your router should be like this.
>
> Router::connect('/:location/spots/*, array('controller' =>'spots',
> 'action' => 'index'), array('pass' => array('location'),'location' =>
> '[a-z]+'));
>
> You also need to add the location as an option for pagination in your
> view. So that it includes it when creating the URLs.
>
> $paginator->options(array('url' =>array('location'=>$this-
> >params['location])));
>
> If you don't have the location added as an option, then the Router
> will not match it to your URL pattern, and you need to have the wild
> character at the end of your connect URL, because pagination generates
> many types of parameters. Such as page, sorting, and field.
>
> >
>

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