Welcome Guest, Not a member yet? Register   Sign In
HMVC and CMS
#1

[eluser]Unknown[/eluser]
Background:

In the past I have just used the default CodeIgniter install and created models, controllers and views within their respected folders. I noticed that from project to project there was a lot of overlap in the functionality i.e. faqs, page content etc., so I decided to install the HMVC module. The main goal was to group like content (i.e. faqs and faq categories) into like modules so I could move them around from project to project with easy.

I am routing the CMS to the root directory with "admin" appended to it i.e. http://localhost/cms/admin/... using these routes:
Code:
(application/config/routes.php)
$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";

Issue:

With the addition of the "modules" it allows the application to include the sub-folders within modules in the url like this:
Code:
URL: http://localhost/cms/admin/faqs/index
Directory: application/modules/faqs/controllers/faqs.php - admin_index (method)
-or-
URL: http://localhost/cms/admin/faqs/index
Directory: application/controllers/faqs.php - admin_index (method)

the problem is when I try and to this:

Code:
URL: http://localhost/cms/admin/faqs/categories/index
Routed Directory: application/modules/faqs/controllers/faqs.php - admin_categories (method)
Desired Directory: application/modules/faqs/controllers/categories.php - admin_index (method)

I understand that because the application can now look in two places, I cannot depend on the URL being simply "controller/method", it can also be "module/controller/method".

I have tried to attack this by overwriting the core, but with no result.

Thank you in advance if you can help.


Messages In This Thread
HMVC and CMS - by El Forum - 02-09-2010, 04:14 PM
HMVC and CMS - by El Forum - 02-09-2010, 05:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB