Welcome Guest, Not a member yet? Register   Sign In
Extending CI_Controller
#1

[eluser]boytun[/eluser]
Hello
Please can some one tell me how can I extend Ci_ Controller with MX_Controller (HMVC).
Thanks
#2

[eluser]TheFuzzy0ne[/eluser]
I'd have thought MX_Controller already extends CI_controller, so you only need to extend MX_Controller.
#3

[eluser]Otemu[/eluser]
What Fuzzy says is correct, follow the notes below:

Quote:Notes:

To use HMVC functionality, such as Modules::run(), controllers must extend the MX_Controller class.

To use Modular Separation only, without HMVC, controllers will extend the CodeIgniter Controller class.

You must use PHP5 style constructors in your controllers. ie:

Code:
<?php
class Xyz extends MX_Controller
{
    function __construct()
    {
        parent::__construct();
    }
}

Source:

https://bitbucket.org/wiredesignz/codeig...sions-hmvc
#4

[eluser]boytun[/eluser]
Thanks friends for your replys
Very simple in the core folder, we just create a file named MX_Controllerand we put this simple code and everything work fun:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MX_Controller extends CI_Controller {

public function index() { }

}




Theme © iAndrew 2016 - Forum software by © MyBB