Codeigniter HVMC模块化分隔扩展URL重写/路由 [英] Codeigniter HVMC modular seperation extension URL rewrite / routing

查看:153
本文介绍了Codeigniter HVMC模块化分隔扩展URL重写/路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用HVMC模块化扩展,它的工作很好,但我有麻烦弄清楚如何使用,以及是否可以使用HVMC的URL路由。

Ive been using HVMC modular extension, and its working great, but Im having trouble figuring out how to use, and if it is possible to use URL routing with HVMC.

基本上,我有一个名为site的模块,这是我的主要默认站点控制器。所有其他模块我没有直接使用,我只使用它们通过调用echo模块:: run('controller / method'); - 所以基本上我只是想从URL中删除网站,以便所有的方法

Basically, I have a module called "site", which is my main default site controller. All of the other modules I am not using directly, I am only using them by calling echo modules::run(‘controller/method’);—So basically I just want to remove "site" from the URL so that all the methods within the site module/controller appear without the word "site" in it.

任何人都可以告诉我HVMC模块化扩展是否可以做到这一点?

Can anyone tell me if this can be done with HVMC modular extensions?

任何帮助非常感谢!

推荐答案

为了完整性,我一直在研究我自己的解决方案这个问题,并删除网站可以通过在routes.php配置文件中添加以下内容来实现。

For completeness I have been researching my own solution to this issue and the removal of the "site" prefix on the URI string can be achieved by adding the following into the routes.php config file.

$route['(:any)'] = "site/$1";
$route['default_controller'] = "site";

这篇关于Codeigniter HVMC模块化分隔扩展URL重写/路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆