• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HMVC Issue when loading Models

Hi, I"m hoping someone who has experience using Modular Extensions - HMVC can help me. I'm trying to load a model and it's throwing an error with the Controller ME requires. The error I'm getting is:

Quote:Fatal error: Cannot access empty property in /Library/WebServer/vhosts/cms/cms/trunk/v1.1/system/application/libraries/Controller.php on line 330

And that line is:

$this->$_alias = new $model();

I did a simple die($model) before the line and the variable has the correct class name for the model. I'm calling the model using:

$this->load->model('admin_media_model', '', true);

I've tried it in both the constructor for the controller and in the function I'm calling and both result in the error above. I've also tried moving it out of the models folder in the module and into the default models folder and got the same error.

Any help would be appreciated.


Just read through the FAQs on this and they don't use the alias or autoconnect params. Tried it without either and autoloading via the database and it seems to be working.

$this->load->model('admin_media_model', 'admin_media_model', true);

Welcome to CI forums too.

The empty alias causes the error, Good luck.

Thanks. I should of tried that before posting, it works.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.