Welcome Guest, Not a member yet? Register   Sign In
Merging Facebook SDK with CodeIgniter 2.0
#2

[eluser]davidbehler[/eluser]
Quote:Unfortunately unlike a lot of other tutorials say you can just create a config file for facebook, well that was for the modified and butchered versions of the facebook api.
I got no idea what you are talking about...what butchered version!? But I don't see a reason why you can't just use a config file instead of passing the config values manually each time you load the lib!?

Just create a facebook.php in /config and add this as its content:
Code:
<?php
$config['appId'] = 'your_app_id';
$config['secret'] = 'your_app_secret';
$config['cookie'] = true;
?>
Now whenever you want to use the facebook lib, all you have to do is call
Code:
$this->load->library('facebook');
and CI will automatically take the values from the config file and pass them as the first parameter to the constructor of the library...pretty much the same thing you did manually.

This way you can use the lib where ever you want and don't have to worry about copying the credentials each time.

P.S.: I've never worked with the FB API/this lib before, it's just some comment based on my experience with CI.


Messages In This Thread
Merging Facebook SDK with CodeIgniter 2.0 - by El Forum - 03-12-2011, 03:44 PM
Merging Facebook SDK with CodeIgniter 2.0 - by El Forum - 03-13-2011, 05:41 AM
Merging Facebook SDK with CodeIgniter 2.0 - by El Forum - 03-13-2011, 05:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB