Call to a member function load() on a non-object when autoloading config files at CI3 |
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; Code: A PHP Error was encountered Severity: Notice Message: Undefined
Of the code you embed, which line is line 16? Can you post the full controller?
On another note, I remember I struggled a lot a year ago when Facebook released the new v4 of the Facebook SDK. And to get it to work with CI. Since then I have used it a few time and today I made my own built library available in my github account. I hope it will be used or at least help others to figure out how integrate the Facebook SDK with CodeIgniter. https://github.com/darkwhispering/facebo...odeigniter
Of course it can't access the config method, because $this tells the PHP that it should look for the method inside the FacebookSession class. You should first store the config items inside two variables, and then put those variables inside that static method parameters
Website: http://avenir.ro
Just a note..
in __construct() you should put at 1st line PHP Code: parent::__construct(); Else you are not preloading parent constructor > https://github.com/bcit-ci/CodeIgniter/b...er.php#L66 and inside it you have some very important things All classes including config are loaded there.. You can't access it if you haven't call parent construct 1st.. Best VPS Hosting : Digital Ocean
(04-03-2015, 01:35 AM)silentium Wrote: Of the code you embed, which line is line 16? Can you post the full controller? Excellent, I can change to this one easily, can this be installed via composer.json file? (04-03-2015, 03:01 AM)sv3tli0 Wrote: Just a note.. Yes, you're right, that was the problem but now I'm running in a second issue cause I got a blank page and facebook stuff doesn't work
Good I have this part done, but when I use some of the code at Example.php I got a blank page, why? Can you help me to get this working? BTW have you a library for Twitter or just this one?
Have you checked the log files in /application/logs for any errors? The library log any error that the Facebook SDK throws.
If you don't have any log, make sure the logs folder is writable by the server, and that you have turned logging on in application/config/config.php Regarding Twitter, I do not have a library for the Twitter API at this time. |
Welcome Guest, Not a member yet? Register Sign In |