code igniter Modular Extensions - Access level to MX_Router::_set_default_controller() must be public (as in class CI_Router)
Solution 1
I had to change several methods visibility in Router.php , so I changed the following methods from protected
to public
to get it fixed
_set_default_controller()_set_request()_set_default_controller()
and it almost worked but now i get a warning above the familiar Welcome to CodeIgniter message
Message: Undefined property: MY_Router::$translate_uri_dashes
so I wrapped this property around an if not empty to bypass this property like so
if(!empty($this->translate_uri_dashes)) { if ($this->translate_uri_dashes === TRUE) { foreach(range(0, 2) as $v) { isset($segments[$v]) && $segments[$v] = str_replace('-', '_', $segments[$v]); } } }
and now it works!
Solution 2
there is a ready HMVC-ci that can be downloaded from
but it's a ci 2.0.3 version not ci 2.2.2
Solution 3 (best)
if you place the core files (MY_Loader and MY_Router) and the third-party folder (MX) from the preconfigured version of ci 2.0.3 (link above) inside the corresponding locations in the ci 2.2.2 it will work just fine.