Paladyn wrote > Sorry for duplicating post but first Subject wasn`t clear enough and I`m > really stuck at this... > > I`m trying to set some action (event) on flag to change language Param and > redirect to previous route. > > lang/admin/controller/action/id -> clicking on flag -> set change lang > param -> go back to lang/admin/controller/action/id > > There are two ways of doing it I can find myself: > Set some event on flag to change lang Param and relunch controller action > (I have big problem with that). > > Getting route match in bootstrap then pass vars to view (passing variables > from bootstrap to view is`t best thing probably...) and write full route > with different language on flag (with different language set). > > I will be very grateful for any tips/help.
Oh man, I think solution to that is quite simple. Let's say you are on page http://site.com/en/admin/article/get/id/5. Then you've got header where you got your flags as links. You can go here two ways: - construct links using url helper by using current route name and override language param per each language, so you would have something like: http://site.com/de/admin/article/get/id/5 or http://site.com/pt/admin/article/get/id/5 - second way is to generate urls with nly language code bit, lke: http://site.com/de http://site.com/pt Disadvantage here is that somehwa you would need to redirect back to previous url which can be achieved by registering it in session Once you got that then onBoostrap on dispatch event you need to use RouteMatch to detect and change locale and in the first case above you will redirect to the same route with new language code and in the second case use session to read old location. I hope it makes sense now. ----- Cheers, -- Luke Mierzwa -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Language-Route-tp4657679p4657680.html Sent from the Zend Framework mailing list archive at Nabble.com. -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com