Welcome Guest, Not a member yet? Register   Sign In
RuntimeException when load model in another modules - HMVC
#1

I have a new problem with Codeigniter HMVC when deploy my project to hosting Unix (it works well on localhost)


Code:
$this->load->model('User_management/Muser_management');


When I call Muser_management model file in User_profile controllers it throws an error:


Type: RuntimeException Message: Unable to locate the model you have specified: Muser_management

My structure

Code:
>root
 >application
    >modules

      >User_management
         >controllers
            User_management.php  
         >models
            Muser_management.php

      >User_profile
         >controllers
            User_profile.php  ->>call Muser_management model error
         >models
            Muser_profile.php

My Muser_mangement.php file:


Code:
<?php
   defined('BASEPATH') or exit('No direct script access allowed');

   class Muser_management extends MY_Model{

       public function get_listuser()
       {  
           $this->db->select('id,label,email,role');
           $user=$this->db->get('user');
           return $user->result();
       }
}
?>

Please help, thanks


Reply
#2

(This post was last modified: 04-08-2016, 01:12 PM by PaulD. Edit Reason: Added PS )

This may not help at all, but try changing

PHP Code:
$this->load->model('User_management/Muser_management'); 

to

PHP Code:
$this->load->model('user_management/muser_management'); 

Paul.

PS Also, not sure if this will make any difference (or even if it is important) but models do not need the closing php tag.( ?> ) If you have a trailing white space that might cause problems too (or so I have been led to believe although I am not sure I completely understand why).
Reply




Theme © iAndrew 2016 - Forum software by © MyBB