Constructor error? |
[eluser]Hamed[/eluser]
I use one of website tutorial and now I get error on constructor: Fatal error: Call to undefined method CI_Controller::Controller() in C:\wamp\www\application\controllers\main.php on line 5 Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]CroNiX[/eluser]
It must be outdated. We use php5's __construct() for constructors now. Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); But the main error you are seeing is because you used "parent::Controller();" instead of "parent::CI_Controller();", but that's moot if you use the new construct above. Please see the user guide for Controllers (this is mentioned at the bottom) |
Welcome Guest, Not a member yet? Register Sign In |