Welcome Guest, Not a member yet? Register   Sign In
HMVC Issue when loading Models
#1

[eluser]jtkendall[/eluser]
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:

Code:
$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:

Code:
$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.

Edit:

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.
#2

[eluser]wiredesignz[/eluser]
Try:
Code:
$this->load->model('admin_media_model', 'admin_media_model', true);

Welcome to CI forums too.

EDIT:
The empty alias causes the error, Good luck.
#3

[eluser]jtkendall[/eluser]
Thanks. I should of tried that before posting, it works.




Theme © iAndrew 2016 - Forum software by © MyBB