Welcome Guest, Not a member yet? Register   Sign In
Codeigniter HMVC bug ?
#4

[eluser]r4f[/eluser]
Okay I will try to explain it here the best I can:
I have a small custom CMS system, where we use it with MX to include different kind of modules.

The auto-load model includes this code in the __construct method:
Code:
// load the modules
$this->load->model('modules_model');

This loads the modules_model model and runs the __construct method which is this:
Code:
class Modules_model extends CI_Model
{    
    public function __construct() {
        parent::__construct();
        
            //load all the active modules from the database
        $query = $this->db->get_where('cms_modules', array('active' => 1));
        foreach ($query->result() as $row)
        {
            $m_path =  realpath(MODULES_PATH);
                // if dir exists, load
            if(is_dir($m_path . "/" . $row->name)) {
                if(file_exists(MODULES_PATH . $row->name . '/info.php')) {
                    Modules::run($row->name);
                }
            }
        }        
    }
}

One of the rows from DB is for example "gallery". So it for example looks like this "Modules::run('gallery')".

Inside the gallery controller:
Code:
class Gallery extends MX_Controller {
    public function index()
    {
        // add this to admin mainmenu
        Modules::run("cms_extra/add_to_admin_bar", "Gallery", urlencode(base_url()."cms/admin/gallery/1/view_admin_gallery"), 60);
    }
}

The error that comes up says that class Gallery is not found.

The controller is in /modules/gallery/controllers/
The other files mentioned are in /system/application/models/ folder.

If you can get this to work then something is wrong with my setup.....


Messages In This Thread
Codeigniter HMVC bug ? - by El Forum - 06-21-2012, 01:46 AM
Codeigniter HMVC bug ? - by El Forum - 06-21-2012, 02:35 AM
Codeigniter HMVC bug ? - by El Forum - 06-21-2012, 03:41 AM
Codeigniter HMVC bug ? - by El Forum - 06-24-2012, 04:13 AM
Codeigniter HMVC bug ? - by El Forum - 06-24-2012, 06:51 AM
Codeigniter HMVC bug ? - by El Forum - 06-25-2012, 04:04 AM
Codeigniter HMVC bug ? - by El Forum - 06-25-2012, 03:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB