Newb Question on Exteneding Default Controller/Sessions |
[eluser]steven2[/eluser]
[quote author="Dam1an" date="1245560120"]That's not what I meant to do Instead of calling the constructor in AuthenticatedController you should leave it as it was (__construct) and change the call from within the welcome controllers constructor to be parent::__construct() As it is at the moment, the 'constructor' in the AuthenticatedController isn't actually a constructor, as it's not the same name as the class (PHP4 syntax) or __construct (PHP5 syntax) Make sense?[/quote] Yes it makes sense and works perfectly. And thank you soo much for your help! MY_Controller.php Code: if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Welcome Controller Code: class Welcome extends AuthenticatedController { This works exactly as I expected it to, but seems to conflict with the userguide http://ellislab.com/codeigniter/user-gui...nstructors which says Quote:In PHP 5, constructors use the following syntax: This is probably where my confusion is coming from. Am I misreading what the user guide is saying? |
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
|