Models Oddity? Fatal error: Call to a member function on a non-object |
[eluser]SitesByJoe[/eluser]
I have a controller that has a couple functions. The first line of each function calls a model, then runs a couple functions in the model to gather the data needed to pump into the view. No biggie. But oddly, this started happening: Fatal error: Call to a member function on a non-object This error will show as soon as more than one call to the model is made on the same controller. I can't figure out why for the life of me. My Controller Code: Code: class Categories extends Controller { As you can see the 2 functions, index() and view() are identical. Index() works fine if I comment out the view() function. If I un-comment the function the error comes up! Any ideas why? Even stranger is the fact that it was working fine before. Thanks!
[eluser]SitesByJoe[/eluser]
After some more testing it appears the fact that my function is called "view" could be part of the problem...
[eluser]Seppo[/eluser]
That's correct if you are running PHP 4. Take a look at Reserved names user guide page. |
Welcome Guest, Not a member yet? Register Sign In |