How to implement HMVC in codeigniter 3.0?

sitrarasu annadurai picture sitrarasu annadurai · Jun 16, 2015 · Viewed 30.2k times · Source

Currently I'm using codeigniter version 3.0. I want to know how to implement HMVC structure in it, can anyone help?

Answer

Limitless isa picture Limitless isa · Jun 23, 2015

codeigniter 3 hmvc modules folder for:

https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/downloads

1- Download files and copy C.i.3.0 forder in application

2- .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

3- create /application/modules

4- /application/modules/welcome create in controllers, models, views

5- Create /application/modules/welcome/controllers/Welcome.php

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

    public function index()
    {
        $this->load->view('welcome_message');
    }
}

enjoy :)

IMPORTANT : 'controllers' and 'models' initials files in the folder should be large. 'views' of files per folder in the letter should be small

enter image description here