Codeigniter 3 HMVC has been broken Codeigniter 3 HMVC has been broken codeigniter codeigniter

Codeigniter 3 HMVC has been broken


I change the line of codes on the function set_class like this:

    {        //this is the original codes I commented    /* $suffix = $this->config->item('controller_suffix');        if (strpos($class, $suffix) === FALSE)        {            $class .= $suffix;        }        parent::set_class($class);     */      //and change with this one        $suffix = (string) $this->config->item('controller_suffix');        if ($suffix && strpos($class, $suffix) === FALSE) {            $class .= $suffix;        }        parent::set_class($class);    }Source: https://forum.codeigniter.com/thread-72393.html


Just Update the function in Router.php File Path: application\third_party\MX\Router.php

public function set_class($class)    {    //  $suffix = $this->config->item('controller_suffix');    //  if (strpos($class, $suffix) === FALSE)    $suffix = (string) $this->config->item('controller_suffix');    if ($suffix && strpos($class, $suffix) === FALSE)    {        $class .= $suffix;    }    parent::set_class($class);}

After this it is working fine!