Wednesday, July 29, 2009

Re: How to modify the URLs of $paginator->numbers

in your routes config

//put this after your defined routes so the router knows you are
passing page numbers like /url/page:2 /url/page:3 etc
Router::connectNamed(array('page'));

if you do not specify this your paginated urls will default to /
controller/action
instead of your fancy route.

might want to very your fancy route works normally by testing it in
the view

echo $html->link('test link', array('controller' =>'france', 'action'
=> 'list'));

should output www.myCakePHPApp.com/countries/europe/france/list
if your route is set up right in the first place

best of luck


On Jul 29, 4:38 am, jordicakephp <jordicake...@gmail.com> wrote:
> Good morning everybody,
>
> I've organized my controllers in a manner similar to the following:
>
> /countries
>         /africa
>         /america
>         /europe
>                 /france
>                 /italy
>                 /spain
>
> And I've created them in their respective folders. Consequently, I've
> also configured my routes.php file, writing many lines. Like these:
>
> Router::connect('/countries/europe/france/list', array('controller' =>
> 'france', 'action' => 'list'));
>
> However, when I use $paginator->numbers and paginate France, the
> numbers that the application displays lead to URLs of this type:
>
> www.myCakePHPApp.com/france/list
>
> But I would like the numbers to lead to URLs likewww.myCakePHPApp.com/countries/europe/france/list, as I've configured
> in routes.php.
>
> What must I do to change the way Cake associates the URLs to the
> numbers displayed by $paginator->numbers?
>
> Thanks a lot in advance!, my dear baker friends.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: