gpt4 book ai didi

php - 在 Codeigniter-HMVC 项目中以标准方式管理 URL

转载 作者:可可西里 更新时间:2023-11-01 01:12:42 25 4
gpt4 key购买 nike

我在 codeigniter-HMVC 中开发了项目,现在我想以标准方式管理 url。

我当前的网址:

http://xyz/home/contactus
http://xyz/home/aboutus
....
....

我想要的就像:

http://xyz/contactus
http://xyz/aboutus
....
....

我正在使用 HMVC codeigniter 结构。

最佳答案

您可以在 routes.php 中定义自定义路由

$route['contact-us'] = "home/home/contactus";
^ ^ ^ ^
New URL module Controller Method

在 URL 中调用 xyz/contact-us' 可以正常工作

Read more about CodeIgniter route

关于php - 在 Codeigniter-HMVC 项目中以标准方式管理 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48921401/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com