Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load a model from another module with CodeIgniter

Im using the HMVC extension with CodeIgniter and i got 2 modules

modules/frontpage
  -- controllers
    frontpage.php ( <- this controller needs to load the person model)
  -- models
  -- views
modules/person
  -- controllers
  -- models
    person_model.php ( defines Person_Model extends Model )
  -- views

using $this->load->model('person_model') inside frontpage controller seems to load only global or models contained in the same module (frontpage models).

Any CodeIgniter experts here?

like image 817
Vidar Vestnes Avatar asked Jun 28 '10 21:06

Vidar Vestnes


1 Answers

Found it... it was a simple fix.

Just had to use: $this->load->model('person/person_model');

like image 185
Vidar Vestnes Avatar answered Nov 15 '22 12:11

Vidar Vestnes