Fatal error: Call to a member function item() on a non-object
Posted
by Andree
on Stack Overflow
See other posts from Stack Overflow
or by Andree
Published on 2010-04-15T10:40:57Z
Indexed on
2010/04/15
10:43 UTC
Read the original article
Hit count: 334
php
Hi there!
I have a weird problem. I have a PHP class with the following method:
public function __construct()
{
parent::__construct();
$this->CI =& get_instance();
$this->log(method_exists($this->CI->config, 'item')); // Outputs TRUE
$firephp_enabled = $this->CI->config->item('firephp_enabled'); // Error point
$this->setEnabled($firephp_enabled);
}
$this->CI->config
has a method item
, and it has been verified using method_exists()
. But when I call $this->CI->config->item()
, I got the following error:
Fatal error: Call to a member function item() on a non-object
Can anyone tell me what might be the problem here?
Thanks, Andree.
© Stack Overflow or respective owner