PHP code example of codinghamster / codeigniter-modular-extensions-hmvc

1. Go to this page and download the library: Download codinghamster/codeigniter-modular-extensions-hmvc library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codinghamster / codeigniter-modular-extensions-hmvc example snippets




class MY_Loader extends MX_Loader {}



class MY_Router extends MX_Router {}

$config['modules_locations'] = array(
    APPPATH.'modules/' => '../modules/',
);

class Xyz extends MX_Controller
{
    public $autoload = array(
        'helper'    => array('url', 'form'),
        'libraries' => array('email'),
    );
}

class Xyz extends MX_Controller
{
    public function __construct()
    {
        parent::__construct();
    }
}

$route['module_name'] = 'controller_name';

/** module and controller names are different, you must re);

/** module and controller names are the same but the method is not 'index' **/
Modules::run('module/method', $params, ...$more);

/** module and controller names are the same and the method is 'index' **/
Modules::run('module', $params, ...$more);

/** Parameters are optional, You may pass any number of parameters. **/



/** application/libraries/MY_Form_validation **/
class MY_Form_validation extends CI_Form_validation
{
    public $CI;
}



class Xyz extends MX_Controller
{
    function __construct()
    {
        parent::__construct();

        $this->load->library('form_validation');
        $this->form_validation->CI =& $this;
    }
}

<?=Modules::run('module/controller/method', $param, ...$more);