ArmetizFacebookBundle
A simple bundle to expose Facebook SDK., (*1)
Usage example
get("armetiz.facebook");
$facebookSdk->setAccessToken($facebookToken);
$userProfile = $facebookSdk->api('/' . $facebookId, 'GET');
}
}
?>
Installation
Installation is a quick 3 step process:, (*2)
- Download ArmetizFacebookBundle using composer
- Enable the Bundle
- Configure your application's config.yml
Step 1: Download ArmetizFacebookBundle using composer
Add ArmetizFacebookBundle in your composer.json:, (*3)
{
"require": {
"armetiz/facebook-bundle": "*"
}
}
Now tell composer to download the bundle by running the command:, (*4)
``` bash
$ php composer.phar update armetiz/facebook-bundle, (*5)
Composer will install the bundle to your project's `vendor/armetiz` directory.
### Step 2: Enable the bundle
Enable the bundle in the kernel:
``` php
get("armetiz.facebook.myApplicationA");
$facebookSdkB = $this->get("armetiz.facebook.myApplicationB");
$facebookSdkA->setAccessToken($facebookToken);
$facebookSdkB->setAccessToken($facebookToken);
$userProfileFromA = $facebookSdkA->api('/' . $facebookId, 'GET');
$userProfileFromB = $facebookSdkB->api('/' . $facebookId, 'GET');
}
}
?>