Results 1 to 2 of 2

Thread: [Zend 1.8][Zend_route] Language param defined in route ?

  1. #1
    Lopimp is offline Junior Member
    Join Date
    Oct 2009
    Posts
    2

    Default [Zend 1.8][Zend_route] Language param defined in route ?

    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

  2. #2
    Lopimp is offline Junior Member
    Join Date
    Oct 2009
    Posts
    2

    Default

    Still no idea how to deal with this?

Similar Threads

  1. 'Route default is not defined' Using Custom routes.ini File
    By gregl83 in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 08-01-2010, 05:30 AM
  2. Undocumented option 'route', route untranslated content phrases to default language
    By tueschej in forum Internationalization (i18n) & Localization (l10n)
    Replies: 3
    Last Post: 07-18-2010, 01:53 PM
  3. Replies: 0
    Last Post: 02-18-2010, 04:01 AM
  4. zend route assembling parameters from other route
    By erwanpia in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 11-02-2009, 11:56 AM
  5. Accessing Param's with Zend Controller Router Route
    By timmy_mallet in forum Model-View-Controller (MVC)
    Replies: 2
    Last Post: 12-08-2008, 09:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •