Undefined property when accessing model class |
[eluser]Unknown[/eluser]
hi, please help me with this problem Code: class Test extends Controller Code: A PHP Error was encountered
[eluser]gyo[/eluser]
Well there must surely be an error in your coding. ![]() Make sure the the model exists in the folder (and extend CI_Model if you're using CI 2.0), give a better look at the wonderful user guide for more info, since this is a very basic thing and it should work without problems. Welcome to CodeIgniter!
[eluser]mddd[/eluser]
This problem was discussed only yesterday. Check this reply for information on the 'loading model in a model' situation.
[eluser]gyo[/eluser]
From the provided example it doesn't look like calling a model from a model. :/
[eluser]mddd[/eluser]
I'm sorry, I didn't read well enough. It should work as you do it.. I can't think why the model wouldn't load. Maybe you can do a "print_r($this);" after loading the model? To see if it is loaded and what variable name it has!
[eluser]gor1lla[/eluser]
me n hanburger are from the same team. just to clarify on the code in the first post the Test Controller class and the Category_model class are inside 2 separate files Code: class Test extends Controller
[eluser]gor1lla[/eluser]
i did a print_r($this), below is the output. i didn't see any model loaded inside, why is it so? Code: Test Object
[eluser]neo.cepot[/eluser]
[quote author="HanBurger" date="1282318483"]hi, please help me with this problem Code: class Test extends Controller Code: A PHP Error was encountered I've tried your codes in my localhost server, and there's no error found...
[eluser]gor1lla[/eluser]
the issue happen on the hosting server on my localhost, it is working fine as far as i know, the hosting server is running php 5 on my localhost, i m running php 5 as well is there any setting inside php.ini that can result in this issue? or is there any area i can go and investigate to determine the source of the problem? any help is greatly appreciated.
|
Welcome Guest, Not a member yet? Register Sign In |