我有一个网站;我需要开发支持多种语言,例如 en、tr、ar、sp 等。
但问题是,使用 Codeigniter 实现这一点的最佳方法是什么?
我有一个控制器(SITE)。我有很多功能,例如(酒店,城市,页面,博客)
我想在此方法之前添加一个段(语言)。这是旧链接
http://example.com/hotel/mariot
http://example.com/hotel/hilton
http://example.com/city/london
http://example.com/city/paris
...
..
我希望链接是这样的
http://example.com/en/hotel/mariot
http://example.com/ar/hotel/mariot
http://example.com/sp/hotel/mariot
http://example.com/tr/hotel/mariot
http://example.com/en/city/london
http://example.com/ar/city/paris
....
..
有时认为每种语言都有一个控制器,但这是可能的......
更改所有链接以支持语言的最佳方法是什么?
抱歉,如果我的问题不清楚,这是我的英语。
正确的方法是使用routes.php在里面查找它(application/config/routes.php)
您可以使用正则表达式来解决您的特定问题。
这是手册:http://ellislab.com/codeigniter/user-guide/general/routing.html http://ellislab.com/codeigniter/user-guide/general/routing.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)