CodeIgniter Forums
Why doesn't CodeIgniter declare its variables? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Why doesn't CodeIgniter declare its variables? (/thread-26276.html)



Why doesn't CodeIgniter declare its variables? - El Forum - 01-10-2010

[eluser]Bjørn Børresen[/eluser]
Here's a snippet from CI_Base:

Code:
class CI_Base extends CI_Loader {

    function CI_Base()
    {
        // This allows syntax like $this->load->foo() to work
        parent::CI_Loader();
        $this->load =& $this;
        
        // This allows resources used within controller constructors to work
        global $OBJ;
        $OBJ = $this->load; // Do NOT use a reference.
    }
}

In the constructor $this->load is set, but why isn't the variable declared?

I'm trying to get auto-completion to work, and declared variables would help.


Why doesn't CodeIgniter declare its variables? - El Forum - 01-10-2010

[eluser]Sean Gates[/eluser]
You mean for autocompletion in your editor?


Why doesn't CodeIgniter declare its variables? - El Forum - 01-11-2010

[eluser]Bjørn Børresen[/eluser]
Yes, specifically Zend Studio, or any Eclipse based IDE really...