Welcome Guest, Not a member yet? Register   Sign In
why this error?
#1

[eluser]osgaldor[/eluser]
I'm creating test controllers and everything had been working okay until this last function I wrote to test the url helper. I'm now getting this error:
Fatal error: Undefined class constant 'CI_Controller' in C:\wamp\www\codeigniter\CodeIgniter_2.1.0\application\controllers\dorjeboard.php on line 5

on line 5 is the parent::CI_Controller; call in the constructor. WTH?
#2

[eluser]InsiteFX[/eluser]
Code:
parent::CI_Controller
// should be
parent::__construct();
#3

[eluser]osgaldor[/eluser]
THANKS!!!
#4

[eluser]osgaldor[/eluser]
isthat two underscores?__
#5

[eluser]InsiteFX[/eluser]
Yes, both have double underscores.
Code:
public function __construct()
{
    parent::__construct();
}
#6

[eluser]osgaldor[/eluser]
Ok, that worked, but it just loaded my next view appended on to the same page. I'm using the url helper, how do I get it to completely reload the page?
#7

[eluser]osgaldor[/eluser]
Never mind. I have a big booboo in my HTML.
#8

[eluser]osgaldor[/eluser]
So for the constructor you don't name it the same name as the class? I named it the class name, not __construct();
#9

[eluser]InsiteFX[/eluser]
It should be the way I showed you above that is the PHP 5 constructor.

Naming the constructor with the class name is PHP 4 way.
#10

[eluser]osgaldor[/eluser]
Ok. Thanks. I've been watching some older tutorials I guess.




Theme © iAndrew 2016 - Forum software by © MyBB