Zend framework Zend框架URL程序集忽略转换
我有以下路线设置:Zend framework Zend框架URL程序集忽略转换,zend-framework,zend-route,zend-translate,Zend Framework,Zend Route,Zend Translate,我有以下路线设置: routeXY.type = "Zend_Controller_Router_Route" routeXY.route = "@XY" routeXY.defaults.module = "default" routeXY.defaults.controller = "index" routeXY.defaults.action = "actionXY" 然后在我的平移数组中也配对(XY->YZ) 如果我尝试访问翻译后的URL段,如: localhost/YZ 我得到了正
routeXY.type = "Zend_Controller_Router_Route"
routeXY.route = "@XY"
routeXY.defaults.module = "default"
routeXY.defaults.controller = "index"
routeXY.defaults.action = "actionXY"
然后在我的平移数组中也配对(XY->YZ)
如果我尝试访问翻译后的URL段,如:
localhost/YZ
我得到了正确的动作“actionXY”
然而,当我试图使用ViewURL帮助程序来组装URL时,它总是构建未翻译的URL。电话:
<?= $this->url(Array('@locale' => Zend_Registry::get('Zend_Locale')), 'routeXY', true);?>
将区域设置设置为获取“YZ”时,获取:
localhost/XY
如何在组装过程中强制转换?最后,我的理解有点错误。我需要用引导默认语言显式设置,从中应该翻译路由。此语言必须是“源”语言,而不是目标语言:
Zend_Controller_Router_Route::setDefaultLocale('any_lang');
此语言中的字符串用作默认翻译键