Professional Documents
Culture Documents
Step by Step To Develop A Facebook Application Using Codeigniter
Step by Step To Develop A Facebook Application Using Codeigniter
Step by Step To Develop A Facebook Application Using Codeigniter
In application/config/config.php
4. We have to set a default controller i.e. the controller file which will run first. Assume that we
have a controller named “welcome” . so set the default controller in
application/config/routes.php by setting $route['default_controller'] =’welcome’ .
b. Unzip the package and open it there are two folder in it “php” and
“footprints” open the “php” folder there are three files and one folder,
just rename the facebook.php to facebook_pi.php and place all
these contents to application/plugins, if plugins folder is not there,
just create it.
class Initializer
{
var $__fbApiKey = 'Your App Id';
var $__fbSecret = 'Your App Secret';
var $CI;
function Initializer()
{
$CI =&get_instance();
$CI->load->plugin('facebook');
$GLOBALS['facebook_config']['debug'] = NULL;
$this->facebook = new Facebook($this->__fbApiKey,
$this->__fbSecret);
$this->user = $this->facebook->require_login();
}
}
var $facebook;
var $user;
var $initializer;
$this->load->library('initializer');
$this->initializer = new initializer();
$this->facebook = $this->initializer->facebook;
$this->user = $this->initializer->user;
7. Now just use the server url which was set in config.php and the application
can be seen on facebook, Whatever you would have written in your default
controller named ‘ welcome ‘ would start executing and so on.