![]() |
How to structure codes in HMVC? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to structure codes in HMVC? (/showthread.php?tid=58974) |
How to structure codes in HMVC? - El Forum - 08-10-2013 [eluser]Unknown[/eluser] Hi, I want to create a site to display products and product description in two different webpages. **Products page will contain:** List of products in a grid (Price and name is displayed below the image) Product categorization drop down on the top of the page. (all, cat1, cat2...) I have to join Product, Category, Image tables for this section. **Product description page will contain:** Big image of the product (with name. desc, price, tax) I have to join Product, Category, Image, tax tables for this section. In MVC I need two controllers to display this (Product_list.php and the Product.php). But I'm not sure how can I organize the views and logic in HMVC pattern. I have a rough idea in my mind like below to do this, Create 5 modules **site** - I will create Product_list.php and Product.php in here. Basically they are just loading 2 empty pages with the sites design. **product** Create the product list grid here with the images and the names. Later I can display it inside the Product_list.php by calling this module. **product_category** I'm not sure how to do this. Should I do the product and category table joins here and display it in the Product_list.php page? **product_desc** Join Product, Category, Image, tax tables and display the image and product info in this section. Later I could display this module in the Product.php. **tax** Should I get the product's tax value from this module or just join all the tables in the product_desc module? Please help me to organize this. Support is greatly appreciated. Thanks! :-h |