Welcome Guest, Not a member yet? Register   Sign In
Extending the controller class: can you spot my error?
#3

[eluser]Frank Berger[/eluser]
[quote author="steward" date="1242596988"]1. Change the CI prefix:
application/libraries/HANK_controller.php
Code:
class HankController extends Controller {

    public $foo;

    function HankController()
    {
        parent::Controller; // THIS IS THE ERROR LINE 19
    }
}
}

Fatal error: Undefined class constant 'Controller' in C:\home\...\system\application\libraries\HANK_Controller.php on line 19
[/quote]

As the error states, you're trying to call a constant, and it is true, you're calling a constant. What you want to do is calling a method, so change this:
Code:
function HankController()
    {
        parent::Controller; // THIS IS THE ERROR LINE 19
    }

to this:

Code:
function HankController()
    {
        parent::Controller(); // THIS IS THE ERROR LINE 19
    }

cheers Frank


Messages In This Thread
Extending the controller class: can you spot my error? - by El Forum - 05-17-2009, 10:49 AM
Extending the controller class: can you spot my error? - by El Forum - 05-17-2009, 10:59 AM
Extending the controller class: can you spot my error? - by El Forum - 05-17-2009, 12:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB