在代码点火器中使用hmvc进行模块特定的路由?

时间:2012-09-14 01:19:13

标签: codeigniter routing hmvc

我正在使用带有HMVC的Code igniter,

我们正在创建插入式模块。

我有点困惑的是路由。

我可以添加

$route['gallery/categories'] = 'gallery/categorieseditor';
$route['gallery/categories/(:any)] = 'gallery/categorieseditor/$1';

到主routes.php配置文件,它工作正常。

但我不想编辑模块的主路径文件。

我希望我可以将其放入routes.php中的/modules/gallery/config/文件中,但访问该网址只会给我一个404(访问/gallery/categorieseditor作品)。

如何启动并运行?

1 个答案:

答案 0 :(得分:2)

您的代码中有错误:

$route['gallery/categories/(:any)] = 'gallery/categorieseditor/$1';

应该是:

$route['gallery/categories/(:any)'] = 'gallery/categorieseditor/$1';