Quantcast

Bootstrap + Translate + Route

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Bootstrap + Translate + Route

Elvin Şiriyev
Hi,
with following router i can take url's like that: example.com/en/index/index

at Bootstrap
protected function _initTranslate() {}

i can't take "en" with
Zend_Controller_Front::getInstance()->getRequest()->getParam('lang')

to spesify Zend_Locale;

// my route
$route = new Zend_Controller_Router_Route(':lang/:controller/:action/*',
                          array('lang' => Zend_Registry::get('Zend_Translate')->getLocale(),
                                  'controller' => 'index',
                                  'action' => 'index'));

can anybody help about that?
and
can i write that route in application.ini ?


thanks.

--
Elvin Şiriyev
http://elvin.siriyev.net
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bootstrap + Translate + Route

Elvin Şiriyev
isn't any advice about that?

2009/5/14 Elvin Şiriyev <[hidden email]>
Hi,
with following router i can take url's like that: example.com/en/index/index

at Bootstrap
protected function _initTranslate() {}

i can't take "en" with
Zend_Controller_Front::getInstance()->getRequest()->getParam('lang')

to spesify Zend_Locale;

// my route
$route = new Zend_Controller_Router_Route(':lang/:controller/:action/*',
                          array('lang' => Zend_Registry::get('Zend_Translate')->getLocale(),
                                  'controller' => 'index',
                                  'action' => 'index'));

can anybody help about that?
and
can i write that route in application.ini ?


thanks.

--
Elvin Şiriyev
http://elvin.siriyev.net



--
Elvin Şiriyev
http://elvin.siriyev.net
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bootstrap + Translate + Route

ehijon
This post has NOT been accepted by the mailing list yet.
Hi, have you found a solution for this problem?
I'm now at your same point :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Bootstrap + Translate + Route

semihsari
This post was updated on .
In reply to this post by Elvin Şiriyev
hi Elvin,

resources.router.routes.module.type = Zend_Controller_Router_Route_Module
resources.router.routes.lang.type = Zend_Controller_Router_Route
resources.router.routes.lang.route = ":lang"
resources.router.routes.lang.reqs.lang = "[a-z]{2}"
resources.router.routes.lang.abstract = On

resources.router.routes.default.type = Zend_Controller_Router_Route_Chain
resources.router.routes.default.chain = "lang, module"

example: http://msd.siteolusturucu.com
Loading...