【发布时间】:2013-05-06 15:42:02
【问题描述】:
我有来自https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc的hmvc结构
modules content,创建控制器news_event,并为函数view详细查看 这样的结构
- 模块
- ...
- ...
- 内容
- 控制器
- ...
- 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
【问题讨论】:
标签: php codeigniter