how to use __construct - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: how to use __construct (/showthread.php?tid=51138) |
how to use __construct - El Forum - 04-22-2012 [eluser]Mohammed Zayan[/eluser] I use this code in site controller I want to make sure that the member has logged in Code: class Site extends CI_Controller{ I have this error Fatal error: Call to undefined method CI_Controller::Controller() in D:\xampp\htdocs\stady\CI\application\controllers\site.php on line 14 I make Code: parent::Controller(); Code: parent::CI_Controller(); and have this error Fatal error: Call to undefined method CI_Controller::CI_Controller() in D:\xampp\htdocs\stady\CI\application\controllers\site.php on line 14 how to use __construct - El Forum - 04-22-2012 [eluser]cJando[/eluser] try this Code: parent :: __construct (); how to use __construct - El Forum - 04-22-2012 [eluser]Mohammed Zayan[/eluser] it works Thank you |