Newb Question on Exteneding Default Controller/Sessions |
[eluser]steven2[/eluser]
[quote author="Dam1an" date="1245558320"]Hi, welcome to CI In your welcome controller, in the construct, you're calling parent::Controller, and yet you don't have a Controller function in the parent, you have a __construct(); Also, I'm not sure if you can name the controller differant from the file name, but it's recommended to make the class name the same as the file name, so in this case, call the class MY_Controller and have your controller extend that[/quote] Thanks. I switched up the names of the Controller, I guess if I want to override the default controller I have to called the function "Controller". Makes perfect sense and now works. Code: class AuthenticatedController extends Controller And in Welcome Controller it is now: Code: class Welcome extends AuthenticatedController { Which makes much more sense to me, but why then does it say http://ellislab.com/codeigniter/user-gui...nstructors that for PHP 5 you have to use function __construct() as your constructor? |
Messages In This Thread |
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-20-2009, 05:16 PM
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-20-2009, 05:25 PM
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-20-2009, 05:46 PM
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-20-2009, 05:55 PM
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-20-2009, 06:25 PM
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-20-2009, 06:30 PM
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-20-2009, 07:41 PM
Newb Question on Exteneding Default Controller/Sessions - by El Forum - 06-21-2009, 02:24 AM
|