CI_Controller::__construct PHP Method

__construct() public method

Class constructor
public __construct ( ) : void
return void
    public function __construct()
    {
        self::$instance =& $this;
        // Assign all the class objects that were instantiated by the
        // bootstrap file (CodeIgniter.php) to local class variables
        // so that CI can run as one big super object.
        foreach (is_loaded() as $var => $class) {
            $this->{$var} =& load_class($class);
        }
        $this->load =& load_class('Loader', 'core');
        $this->load->initialize();
        log_message('info', 'Controller Class Initialized');
    }

Usage Example

Example #1
0
 public function __construct()
 {
     parent::__construct();
     parse_str($_SERVER['QUERY_STRING'], $_REQUEST);
     $this->load->library('facebook', array("appId" => '361675743907292', "secret" => '65346749b5c11d2842b322bcc99f247e'));
     $this->user = $this->facebook->getUser();
 }
All Usage Examples Of CI_Controller::__construct