Welcome Guest, Not a member yet? Register   Sign In
How the heck should I structure a HMVC project?
#4

[eluser]gunnarflax[/eluser]
[quote author="Twisted1919" date="1313188927"]the best solution i found when working with hmvc is like:
Code:
modules
--post
---controllers
----admin.php (handles the admin tasks for the post.php controller)
----post.php (the main controller)

--products
---controllers
----admin
----products.php

--forum
---controllers
----admin (in case the module is more complcated, we can put the admin controllers in a folder)
-----thread.php
-----some-other-admin-controller.php
----forum.php
----thread.php

In the above solution, you will reach your modules like
www.host.com/post (reads post.php controller)
www.host.com/post/admin (reads the admin controller)

Also you can add following routes:
Code:
$route['admin/([a-z 0-9~%.:_\-]+)/(.*)']    = "$1/admin/$2";
$route['admin/(:any)']                      = "$1/admin";

so that you access the module admin more naturally, like:

www.host.com/post (reads post.php controller)
www.host.com/admin/post (reads the admin controller)[/quote]

I've found this solution on several sites and it seems to me like the best way to keep a truly modular structure Smile Thank guys, I will continue with this one.


Messages In This Thread
How the heck should I structure a HMVC project? - by El Forum - 08-12-2011, 07:53 AM
How the heck should I structure a HMVC project? - by El Forum - 08-12-2011, 11:42 AM
How the heck should I structure a HMVC project? - by El Forum - 08-12-2011, 11:47 AM
How the heck should I structure a HMVC project? - by El Forum - 08-14-2011, 11:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB