我有来自https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc的 hmvc 结构
模块内容,创建控制器news_event,并为功能视图详细查看结构,如下所示
- 模块
- ...
- ...
- 内容
- 控制器
- ...
- news_event.php
- 控制器
在news_event.php中
我有 3 个功能、索引、视图和页面
function index() { $this->pages(); }
function pages($_pages = 1){ ... }
function view($_id_uri = false){ ... }
我成功了
http://example.com/ci_hmvc/content/news_event/
变得
http://example.com/ci_hmvc/news_event/
但是在加载下一个视图时出现错误
http://example.com/ci_hmvc/news_event/view/my-var-uri-friendly-here
我收到错误 404,但如果我使用此 url 调用,则成功
http://example.com/ci_hmvc/content/news_event/view/my-var-uri-friendly-here
我的路由代码是
$route['news_event'] = 'content/news_event';
$route['news_event/(:any)'] = 'content/news_event/view/$1';
路线如何,如果我想访问
http://example.com/ci_hmvc/news_event/view/my-var-uri-friendly-here
或这个
http://example.com/ci_hmvc/news_event/my-var-uri-friendly-here