Welcome Guest, Not a member yet? Register   Sign In
I have lots of errors in my controller...
#1

[eluser]Udi[/eluser]
Hi.

I have some controller named User,

When I'm running the login() method (wwww.example.com/user/login/)
I get these strange errors:

Quote:Call to a member function isLogged() on a non-object in .... user.php on line 96
Code:
if($this->major->isLogged())

when I comment out this line I get more and more [one after another] errors like this but of other models and libraries..

I upgraded to 1.7, but this problem started even before the upgrade.
#2

[eluser]Steve Grant[/eluser]
The "Call to a member function <functionName> on a non-object" error is generally thrown when the class that contains the function hasn't been initialised correctly.

In your example, I would suggest that $this->major hasn't been initialised properly.

Can you post the controller code?
#3

[eluser]Udi[/eluser]
Not really..
Tell me what you are looking for to find the initializing problem..

The thing is, this is the only controller this is happening in, and there nothing unusual in it.

Oh, and the Major is auto loaded..

EDIT:
It seems that there is really big problem,
even code like this gets me an error:
Code:
$this->load->helper(array('form','url'));
Code:
Fatal error: Call to a member function helper() on a non-object
#4

[eluser]Udi[/eluser]
SOLVED

such stupid problem..

I created a constructor method,
and... now, I deleted it, and it all works. Big Grin

damn, this was a idiotic problem.
#5

[eluser]m4rw3r[/eluser]
Is parent::Controller() called in the constructor?
Because Controller() loads the loader and other core libs into the Controller object.

EDIT: Didn't see that you solved the problem.




Theme © iAndrew 2016 - Forum software by © MyBB