On Apr 7, 2011, at 12:42, ThunderTD wrote:

> I configured my route similar to one example in the CakePHP Book. I
> want to reach the ArtistsController's view action via the URL
> http://xxx/artists/id. Everything is working fine with the following
> Routes entry and this direction:
> 
> Router::connect('/:language/artists/:id',
> array('controller'=>'artists','action'=>'view'), array('pass' =>
> array('id'), 'language' => '[a-z]{3}','id' => '[0-9]{1}'));
> 
> But what about the proper reverse lookup? If I use the HtmlHelper
> Function Link in the following way:
> 
> $html->link('Artist 2', array( 'controller' => 'artists', 'action' =>
> 'view', 2 )) ,
> 
> the link is resolved to http://xxx/artists/view/2 instead of the
> desired http://xxx/artists/2 .
> 
> Is this the desired behavior?

It doesn't look like you specified the language in the $html->link (properly: 
$this->Html->link) command, and your route does seem to rely on the language 
being set. Did you mean to specify it there, or is it being included by some 
other means that you didn't show?



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to