Welcome Guest, Not a member yet? Register   Sign In
$this->load->vars()
#8

[eluser]mihailt[/eluser]
[quote author="xwero" date="1227207794"]Php doesn't make care what type the object is, that is a logical difference. So if you add the variable with the name vars but if you load a library with the same name it's likely somewhere down the line you get bugs.

The loader already keeps an array of the variables for the view files so i don't see why you need another way to store them.[/quote]

Agree with about CI_Loader, but i still don't think there can be any conflicts since
$someobject->vars, $someobject::$vars and $someobject->vars() are pretty obvious different things, and what i suggested was to use static variable, static variables belong to the class and not to the instance of the class, you cannot access it within an object scope. About the logic part it's actaully not a big difference - both are libraries so it doesn't matter much, the only difference is that in one case you would store variables in parent class and in other case you would store it in superobject.


Messages In This Thread
$this->load->vars() - by El Forum - 11-19-2008, 12:44 PM
$this->load->vars() - by El Forum - 11-19-2008, 01:10 PM
$this->load->vars() - by El Forum - 11-19-2008, 02:38 PM
$this->load->vars() - by El Forum - 11-20-2008, 06:01 AM
$this->load->vars() - by El Forum - 11-20-2008, 06:17 AM
$this->load->vars() - by El Forum - 11-20-2008, 06:27 AM
$this->load->vars() - by El Forum - 11-20-2008, 07:03 AM
$this->load->vars() - by El Forum - 11-20-2008, 07:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB