Welcome Guest, Not a member yet? Register   Sign In
Where is this member variable of CI_Controller declared
#1

[eluser]Crusoe[/eluser]
Code:
class Welcome extends CI_Controller {
    public function index()    {
        $this->load->view('welcome_message');
    }
}

If we are able to call $this->load->view successfully either the class Welcome or it's parent CI_Controller should have a member variable called load. I looked for it in the class definition.
Code:
class CI_Controller {
    private static $instance;
    public function __construct(){
        self::$instance =& $this;
        foreach (is_loaded() as $var => $class) {
            $this->$var =& load_class($class);
        }

        $this->load =& load_class('Loader', 'core');
        $this->load->_base_classes =& is_loaded();
        $this->load->_ci_autoloader();
        log_message('debug', "Controller Class Initialized");
     }

    public static function &get;_instance(){
        return self::$instance;
    }
}

It does not have a member variable called load. So, where did load come from ?


Messages In This Thread
Where is this member variable of CI_Controller declared - by El Forum - 06-28-2011, 05:39 AM
Where is this member variable of CI_Controller declared - by El Forum - 06-28-2011, 05:52 AM
Where is this member variable of CI_Controller declared - by El Forum - 06-28-2011, 05:53 AM
Where is this member variable of CI_Controller declared - by El Forum - 06-28-2011, 06:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB