tags:

views:

25

answers:

1

I have a multilingual site and I am trying to use the paginator. However the pages navigation never includes the language (just the controller and action are included)

<?php
 echo $paginator->first(' << ', null, null, null);
 echo $paginator->prev(' < ', null, null, null);
 echo $paginator->numbers();
 echo $paginator->next(' >', null, null, null);
 echo $paginator->last(' >> ', null, null, null);
?> 

Example: URL - http://dev.cyclistsroadmap.com/eng/segments/

Current: http://dev.cyclistsroadmap.com/main/segments/page:5

should be http://dev.cyclistsroadmap.com/eng/main/segments/page:5

A: 

Check this out. You can set extra parameters with paginate->options.

<?php
$paginator->options(array('url'=>array('lang'=>'eng')));
?> 

Then add in your routes.php file like this. Then if you add the parameter in the options (as in the live above) then it should work as you want.

Router::connect('/:lang/:controller/:action/*', array(), array('lang' => 'eng/', 'property' => '[0-9]+'));
Nik
Thanks, but I had already seen and tried that. That gives mehttp://dev.cyclistsroadmap.com/main/segments/page:5/lang:eng
paullb
As far I can see you managed to do it :) Or at least the pagination have the proper lang variable
Nik
As I wrote above, I implemeted a hack to get the job done in the meantime. I still want to do it right in the end.
paullb
paullb - check my answer again, I've modified it.
Nik