this is how I did it.
routes.php
Router::connect('/usuarios/:id/:action/*', array('controller' =>
'usuarios','action' => ':action'),array('id'=>'[0-9]+'));
view
$url = array('url'=>array('controller' => 'usuarios','id' =>
$usuario_id,'action'=>'votos'));
$paginator->prev("<< ".__('Anterior',true), $url );
$paginator->numbers(array_merge(array('separator'=>''),$url));
$paginator->next(__('Siguiente',true)." >>", $url);
So the only difference was not "passing" the "id" in the route, simple
but hard to find
On Jun 22, 10:22 am, Alberto <albertolopezru...@gmail.com> wrote:
> It gives the url
>
> /Usuarios/votos/page:2
>
> without the user id (i.e. /Usuarios/3/votos/page:2)
>
> Actually $this->passedArgs is empty in my view
>
> On Jun 21, 11:45 pm, majna <majna...@gmail.com> wrote:
>
>
>
> > tryhttp://groups.google.com/group/cake-php/msg/e5231eac6bdbecc6
>
> > On Jun 22, 12:21 am, Alberto <albertolopezru...@gmail.com> wrote:
>
> > > I recently migrated my system to 1.3. I solved most of the issues but
> > > not the pagination links in some views therefore I need some help.
>
> > > routes.php
>
> > > Router::connect('/usuarios/:id/:action/*', array('controller' =>
> > > 'Usuarios', 'action' => ':action','id' =>
> > > ':id'),array('id'=>'[0-9]+'));
>
> > > view
>
> > > $url = array('url'=>array('controller' => 'usuarios','id' =>
> > > $usuario_id,'action'=>'votos'))
>
> > > $paginator->prev("<< ".__('Anterior',true), $url );
> > > $paginator->numbers(array_merge(array('separator'=>''),$url));
> > > $paginator->next(__('Siguiente',true)." >>", $url);
>
> > > rendered url in html (/controller/id/page:n/id:action)
> > > /usuarios/3/page:2/id:votos
> > > /usuarios/3/page:3/id:votos
> > > ....
>
> > > However the url I want, as I defined in the routes.php should be (/
> > > controller/id/action/page:n)
> > > /usuarios/3/votos/page:2
> > > /usuarios/3/votos/page:3
>
> > > Any suggetion? Thanks
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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:
Post a Comment