Call to undefined method CI_Controller::Controller() - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Call to undefined method CI_Controller::Controller() (/showthread.php?tid=40323) |
Call to undefined method CI_Controller::Controller() - El Forum - 04-05-2011 [eluser]Unknown[/eluser] Fatal error: Call to undefined method CI_Controller::Controller() in D:\xampp\htdocs\myfirstcodeigniter\application\controllers\user.php on line 6 Hello, I am using CodeIgniter 2.0 and I am new to the framework. I tried extending the CI_Controller class and it is not works for me on my computer using xampp. <?php class User extends CI_Controller { function User() { parent::Controller(); $this->view_data['base_url'] = base_url(); } function index() { $this->register(); } function register() { $this->load-view('user_view', $this->view_data); } } ?> Call to undefined method CI_Controller::Controller() - El Forum - 04-05-2011 [eluser]TWP Marketing[/eluser] [quote author="pangit" date="1302046407"]Fatal error: Call to undefined method CI_Controller::Controller() in D:\xampp\htdocs\myfirstcodeigniter\application\controllers\user.php on line 6 Hello, I am using CodeIgniter 2.0 and I am new to the framework. I tried extending the CI_Controller class and it is not works for me on my computer using xampp. Code: <?php Ver 2.0.1 is the latest and the User_Guide specifies the use of "__construct" as the constructor function name, NOT the controller name as was the case in prior versions (1.7x and earlier). This is to conform with PHP 5. Code: <?php |