多语言 URL

发布于 2024-08-20 19:59:39 字数 379 浏览 4 评论 0原文

在 codeigniter 中,控制器的名称反映了 URL。 但我的问题是,如何在不复制/粘贴所有控制器的情况下创建多语言 URL。

示例:

谢谢

In codeigniter, the name of your controller, reflects the URL.
But my question is, how can you create multi language URLs without copy/pasting all your controllers.

Example:

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小巷里的女流氓 2024-08-27 19:59:39

查看 Code Igniter 用户指南中的 URI 路由

Take a look at URI routing in Code Igniter's user guide.

月光色 2024-08-27 19:59:39

通常使用URL重写过滤器来处理这种行为。

我不熟悉 CodeIgniter,但快速 Google 搜索会显示有关在 CodeIgniter 中使用 mod rewrite 的页面。

Usually a URL rewrite filter is used to handle this kind of behaviour.

I'm not familiar with CodeIgniter but a quick Google search shows this page about using mod rewrite in CodeIgniter.

ㄖ落Θ余辉 2024-08-27 19:59:39

您应该能够通过为每个控制器创建别名来做到这一点。检查你的 config/routes.php 路径

You should be able to do it by creating aliases to each controller. Check your config/routes.php path

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文