I'm working in a small project with CI 3.0. I have set up `/application/config/autoload.php` for autoload app config file as follow:
PHP Code:
$autoload['config'] = array('myappcfg');
Then at controller constructor I'm doing the following:
PHP Code:
protected $facebookSession;
public function __construct()
{
$this->facebookSession = FacebookSession::newAppSession(
$this->config->item( 'facebook_app_id' ),
$this->config->item( 'facebook_app_secret' )
);
}
But I'm getting this notice:
Code:
A PHP Error was encountered Severity: Notice Message: Undefined
property: ShareFacebook::$config Filename:
controllers/ShareFacebook.php Line Number: 16
Backtrace:
File: /var/www/html/dts/myapp/application/controllers/ShareFacebook.php
Line: 16
Function: _error_handler
File: /var/www/html/dts/myapp/index.php
Line: 292
Function: require_once
Fatal error: Call to a member function load() on a non-object in /var/www/html/dts/myapp/application/controllers/ShareFacebook.php on line 16
Can any tell me what I'm doing wrong? Why I can't access `$this->config` at controller if config file is autoloaded?