Hi,

I'm trying to implement this kind of links in my app: example.com/en/
page, example.com/de/page etc.

This is what my router connections look like:

Router::connect('*/pages/edit/', array('controller' => 'pages',
'action' => 'edit'));
Router::connect('*/pages/add/', array('controller' => 'pages',
'action' => 'add'));
Router::connect('*', array('controller' => 'pages', 'action' =>
'display'));

And this is what I've in my app_controllers beforeFilter:

if (in_array(@$this -> params['pass'][0], $this -> languages))
{
        $this -> Page -> locale = $this -> params['pass'][0];
}
else
{
        $this -> Page -> locale = DEFAULT_LANGUAGE;
}

This works fine. But the problem is with links. I must do $html ->
link('link', '/'.$lang.'/page');

I would like change the baseUrl to make Router::url automatically
generate links with language parameter (/en/) in them. Is it possible?
I've tried with Configure::write('baseUrl', '/en/') but without
effects. Is it possible? Or maybe I am completely wrong and I should
rather use .htaccess to rewrite example.com/en/page/ links to, for
instance, example.com/page/lang:en?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to