How to enable HMVC in Codeigniter FrameworkPankaj Bains
HMVC is well known for Hierarchical model–view–controller. It’s a design pattern that will make CodeIgniter a modular MVC framework. Using HMVC you can divide your application by modules like categories, products, coupons, shipping in case of ecommerce website. By dividing our work into modules we can apply new features without touching the others controllers that is not related to our new features. HMVC is also called widgetization because you can used any modules to another modules or views.
Implementing HMVC in CodeIgniter using Wiredesignz’s Modular Extensions – HMVC
The HMVC modular extension can be downloaded from this page Modular Extensions – HMVC. The download page also includes instruction on how to install it.
- Create a new project and name it as per your choice.
- Extract the CodeIgniter zipped file contents into your newly created project directory.
- Extract the contents of wiredesignz-codeigniter-modular-extensions-hmvc-53edddfc167e.
- Copy the contents of core directory into application/core directory
- Copy the contents of third_party into application/third_party directory
- Create a new directory application/modules/welcome
- Move the application/controllers/Welcome.php into application/modules/controllers/Welcome.php
- Move the application/views/welcome_message.php into application/modules/views/welcome_message.php