Hi all,
I've got a question about Zend_route and multi-lingual handeling
I initialise all my routes in my bootstrap class, I've got a function _initRoute that basically read an XML file in which I've got all my routes definitions.
Earch route definition is added to zend_router.
Here is an example of two routes I want to define, they both target to the same action/controller, but in two different language
here is my definition in English
Code:
$route = new Zend_Controller_Router_Route_Regex('login.html?', array(
'controller' => 'login',
'action' => 'index',
'lang' => 'en'
), array(), 'login.html');
And here is my definition in French
Code:
$route = new Zend_Controller_Router_Route_Regex('inscription.html?', array(
'controller' => 'login',
'action' => 'index',
'lang' => 'fr'
), array(), 'inscription.html');
In my bootstrap I also have a function setLanguage($codelangue) that gets a language code and change the language to use in my pages.
Could you help me because I can't catch the language parameter in my bootstrap from the route (it doesn't seem to get the langauge parameter from the route)
When i use assemble() with an array as parameter with action controller and lang (as defined in my route) it doesn't display my URL in teh correct language.
To make it short if my message was not clear enough, here is what I am trying to do
having two URL displaying the same page (action and controller) but with a different language, without puting the language code in the url
so
login.html should display login page in english (login action and index controller)
inscription.html should display login page in french (login action and index controller)
thanks for you help,
don't hesitate to give me another method then the one I tried if it can do the job
thx