After an upgrade of Codeigniter I get this message:
Cannot access protected property MY_Loader::$_ci_cached_vars
I know that this property is now protected so what can I do here?
extract($CI->load->_ci_cached_vars); // extract cached variables
I don’t know how to use the get_var method now, because the property is protected
this is get_var method
/**
* Get Variable
*
* Check if a variable is set and retrieve it.
*
* @param array
* @return void
*/
public function get_var($key)
{
return isset($this->_ci_cached_vars[$key]) ? $this->_ci_cached_vars[$key] : NULL;
}
How to refactor this?
1 Answer