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

[eluser]xwero[/eluser]
I think a class variable is a bad idea because then it's a part of the super object. Because you don't know how all the classes are named that can be added to the super object it's possible you get same name errors.

A way to get the stored vars is to extend the loader class with following method:
Code:
function var($key)
{
   return (isset($this->_ci_cached_vars[$key])) ?  $this->_ci_cached_vars[$key] : NULL ;
}
The usage is
Code:
$this->load->var('some_var');


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