Welcome Guest, Not a member yet? Register   Sign In
how to properly structure controllers in HMVC
#1
Lightbulb 

HI ,
this is my first  project using hmvc. i am confused how to organize modules. my site have admin area , authenticated area and public area.
in mvc i  would do it this way
controllers
--admin
----------users
----------products
----------orders
--public
----------users
----------products
----------orders
--auth
----------users
----------products
----------orders

how to  organize things in hmvc?
          Heart  love codeigniter Heart
          Learning  best  practices
     Rate my post if you found it helpfull
Reply
#2

modules
-- admin
---- users
---- products
---- orders
-- public
---- users
---- products
---- orders
-- auth
---- users
---- products
---- orders
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Also remember

1 table equals 1 model
1 table equals 1 controller
You can create many views...

I learned these from David Conelly
Reply
#4

(06-29-2016, 05:53 PM)InsiteFX Wrote: modules
-- admin
---- users
---- products
---- orders
-- public
---- users
---- products
---- orders
-- auth
---- users
---- products
---- orders

what about models.?i have to create user model in all three modules?
          Heart  love codeigniter Heart
          Learning  best  practices
     Rate my post if you found it helpfull
Reply
#5

Controllers may be loaded from application/controllers sub-directories.

Controllers may also be loaded from module/controllers sub-directories.

--> Resources may be cross loaded between modules. ie: $this->load->model('module/model');

Modules::run() is designed for returning view partials, and it will return buffered output (a view) from a controller. The syntax for using modules::run is a URI style segmented string and unlimited variables.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB