Hi everyone,
I've asked this a few times on IRC, but I guess it's too
complicated(?) to be answered over IRC.
I'm trying to build a multilingual web site, so I've created the
following route:
Router::connect('/:language/:controller/:action/*', array(),
array('language' => '[a-z]{3}'));
Now, if I want to create a few links for switching languages, I do the
following:
foreach ($availableLanguages as $locale => $params)
{
$link = array_merge(array('language' => $locale), $this-
>params['named'], $this->params['pass']);
echo $this->Html->link($image, $link, array('escape' => false));
}
And this actually works, and produces correct results. For example, if
I open an URL:
/hrv/tests/index/drink
The generated links will be in the form of:
/eng/tests/index/drink
HOWEVER...
If the url contains a named param:
/hrv/tests/index/drink/feck:arse
Cake will generate links like this one:
/tests/index/drink/language:eng/feck:arse
So..either I'm missing something, or something is amiss.. I know the
named params are the cause because I can remove $this->params['named']
from the array_merge call and everything works fine.
Any ideas what's wrong here? Is this a router bug?
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 [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