我使用的是带有HMVC模块扩展名的Codeigniter,并具有用于管理网站内容的后端CMS区域。我将基本URL +“admin”(http://localhost/cms/admin)路由到具有前缀“admin_”的控制器方法。Codeigniter HMVC和CMS
e.g. function admin_index() {...}
这里是我的路由:
$route['admin/([a-zA-Z]+)/(:any)'] = "$1/admin_$2"; $route['^admin/(:any)(/)?'] = "$1/admin_index"; $route['^admin(/)?'] = "dashboard/admin_index"; $route['admin/logout'] = "login/admin_logout";
随着HMVC没有正确的路由现在。这里是发生了什么:
URL: http://localhost/cms/admin/faqs Directory: modules/faqs/controllers/faqs - index method -- here is where it breaks -- URL: http://localhost/cms/admin/faqs/categories Directory: modules/faqs/controllers/faqs - categories method (does not exits) Desired: modules/faqs/controllers/categories - index method
如何使用HMVC,同时保持“管理员”是网站?
为了不被周围最聪明的孩子,但不会是更容易管理和具有管理路径在一个地方(例如'在admin'控制器和'管理员/ faq'功能它)和其他地方的一切? – 2010-02-09 20:01:26
HMVC的目的是为了允许一个模块化的结构,在那里你可以直接拾取整个文件夹并将它像模块一样放入另一个安装中。你的目的不符合我想要做的。谢谢,虽然:) – Torez 2010-02-09 20:12:02