用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1042|回复: 2
收起左侧

[版本 3.x] 关于多语言的routes设计问题

[复制链接]
发表于 2016-4-10 16:09:48 | 显示全部楼层 |阅读模式
请问该如何让URL可以支援这种方式?

http://xxxxxx/en/ - English
http://xxxxxx/cn/ - Chinese
http://xxxxxx/fr/ - French

原本 /Core::controller/Core::method/
变成 /Core:anguage/Core::controller/Core::method/

(1)http://xxxxxx/en/news/
=>取出 视图根目录 application\views\en\news.php

(2)http://xxxxxx/cn/news/
=>取出 视图根目录 application\views\cn\news.php

(3)http://xxxxxx/fr/faq/
=>取出 视图根目录 application\views\fr\faq.php


经由语言的通配符路由规则,配置相关的视图语言的目录?


 楼主| 发表于 2016-4-17 19:21:39 | 显示全部楼层
好奇问一下,
是不是这样的方式不好呢
发表于 2016-4-17 20:07:50 | 显示全部楼层
之前写过一个,说下,用hook截取uri——segment(1),设置config的language
路由配置

视图可以不用建多语言的吧? 好吧。这个随意

本版积分规则