脚本宝典收集整理的这篇文章主要介绍了php – Zend翻译的路线,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
例:@H_126_2@
路线为/ de
$routes['industry'] = array( 'route' => 'branche/:tyPE','defaults' => array( 'module' => 'default','controller' => 'index','action' => 'branche','type' => 'automobil' ),'reqs' => array( 'type' => '(automobil|textil)' ) );
路线为/ en
$routes['industry'] = array( 'route' => 'industry/:type','type' => 'car' ),'reqs' => array( 'type' => '(car|textile)' ) );
在这种情况下,它可能以某种方式只有一条路线而不是2条路线?
注意不仅是更改的路由,还有reqs上的类型和默认类型.
$routes['industry'] = array( 'route' => 'industry/:lang/:type','type' => 'car','lang' => 'en' ),'reqs' => array( 'lang' => '(en|de)','type' => '(car|textile)' ) );
并且根据参数lang,您可以在twig或phtML或html上显示正确的消息
另一种更改URL的方法是:
$routes['industry'] = array( 'route' => ':industry/:type','industry' => 'industry' ),'reqs' => array( 'industry' => '(industry|branche)','type' => '(car|textile)' ) );
以上是脚本宝典为你收集整理的php – Zend翻译的路线全部内容,希望文章能够帮你解决php – Zend翻译的路线所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。