How to enable HMVC in Codeigniter Framework

How to enable HMVC in Codeigniter Framework

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.

  1. Create a new project and name it as per your choice.
  2. Extract the CodeIgniter zipped file contents into your newly created project directory.
  3. Extract the contents of wiredesignz-codeigniter-modular-extensions-hmvc-53edddfc167e.
  4. Copy the contents of core directory into application/core directory
  5. Copy the contents of third_party into application/third_party directory
  6. Create a new directory application/modules/welcome
  7. Move the application/controllers/Welcome.php into application/modules/controllers/Welcome.php
  8. Move the application/views/welcome_message.php into application/modules/views/welcome_message.php

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.