Matchbox model loading... |
[eluser]eurotrash[/eluser]
I have Matchbox 0.9.4 and CI 1.6.1 working on my localhost. When I try to load a model I get the following error: Fatal error: Call to a member function model() on a non-object in /Applications/xampp/xamppfiles/htdocs/cim/system/application/modules/articles/controllers/articles.php on line 11 The controllers are working correctly so I am certain that I have installed correctly. Obviously Matchbox is looking in the wrong directory for the model. How do I load a model in the controller from the application directory using matchbox? I am loading the model by calling Code: $this->load->model("article"); I'm pretty sure sure that I need to tweak the $this->load statement in order for it work. Thanks
[eluser]eurotrash[/eluser]
Code: <?php
[eluser]zdknudsen[/eluser]
A fresh install of Matchbox and CodeIgniter, with your controller works fine for me (except for changing the first argument in $this->load->module_model from 'u' to 'users', but that's just because I tested it on a module called 'users'. Remember that the first argument is the module, and the second is the model). Are you sure you have removed previous versions of Matchbox (or Modular Separation)?
[eluser]zdknudsen[/eluser]
Well I ran CI 1.6.2, try updating to that, although I doubt that is the cause. I've zipped my simple working app with your controller so you can see how I did it. http://www.filepanda.com/file/zxpikiwovd8a/
[eluser]eurotrash[/eluser]
Figured it out I had Code: parent::Controller(); instead of Code: parent::Model(); Psyched to start using Matchbox on my next project. Thank
[eluser]zdknudsen[/eluser]
You're welcome. I hope you'll like it. I know I do ;-) |
Welcome Guest, Not a member yet? Register Sign In |