Add URI Segment for Language in Codeigniter

不羁的心 提交于 2019-12-06 06:16:29

if you want your links to be like this http://example.com/en/something

then you might need to have subdomain or folder in your project called en. but yet this is not the perfect solution.

what you have to do is to make your text output assigned into variables which takes their values from an xml file. like if you have some text called "your room number is: 0" and this value is hard coded HTML then you should put it in en.xml file under some tag and get it from the xml file which is requested by the user according to the required lang.

you might can do the previous solution in all languages but you have to consider that Arabic language is RTL language so just consider that in your css. But generally you can use xml files to control the languages.

hope that is what you needed.

The right way, is using routes.php look for it inside (application/config/routes.php)

You can use regex expressions for your specific problem.

here is the manual: http://ellislab.com/codeigniter/user-guide/general/routing.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!