PHPackages                             earlybirds/facebook-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. earlybirds/facebook-bundle

ActiveSymfony-bundle[API Development](/categories/api)

earlybirds/facebook-bundle
==========================

Create a Facebook app into your Symfony2 application.

093PHP

Since Feb 11Pushed 11y ago4 watchersCompare

[ Source](https://github.com/tmsw/EBFacebookBundle)[ Packagist](https://packagist.org/packages/earlybirds/facebook-bundle)[ RSS](/packages/earlybirds-facebook-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

EBFacebookBundle
================

[](#ebfacebookbundle)

1. Add the following lines in your composer.json:

    ```
    {
        "require": {
            "friendsofsymfony/facebook-bundle": "dev-master",
            "friendsofsymfony/user-bundle": "dev-master",
            "earlybirds/facebook-bundle": "dev-master"
        }
    }
    ```
2. Run the composer to download the bundle:

    ```
    $ php composer.phar update
    ```
3. Add bundles to your application's kernel:

    ```
    // app/ApplicationKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new FOS\FacebookBundle\FOSFacebookBundle(),
            new FOS\UserBundle\FOSUserBundle(),
            new EB\FacebookBundle\EBFacebookBundle(),
            // ...
        );
    }
    ```
4. Add the following routes to your application and point them at actual controller actions

    ```
    #app/config/routing.yml
    eb_facebook:
        resource: "@EBFacebookBundle/Resources/config/routing.xml"
    ```

    ```

    ```
5. Configure the `eb_facebook` service in your config:

    ```
    #app/config/config.yml
    framework:
        translator: ~

    eb_facebook:
        app_id: 123456879 #Facebook application ID
        secret: s3cr3t #Facebook application secret
        templates:
            layout:  AcmeDemoBundle::layout.html.twig #Your personnal layout
            home:  AcmeDemoBundle:Demo:home.html.twig #Your personnal home view
            register:  AcmeDemoBundle:Demo:register.html.twig #Your personnal register view
        permissions: [email, user_birthday, user_location] #(Optional) Permissions of the app, if not configured set to default permissions
        fixcookie: https://host_of_facebook_application/fixcookie.php #(Optional) Url to a fix script to debug safari iframe on Facebook
        tab_url: https://www.facebook.com/MYCOMPANY/app_99999999999 #(Optional) Url of your Facebook tab page
        user_class: Acme\DemoBundle\Entity\User #(Optional) Namespace of your own Entity User class, default : EB\FacebookBundle\Entity\User
        form_class: Acme\DemoBundle\Form\UserType #(Optional) Namespace of your own Form User class, default : EB\FacebookBundle\Form\UserType
        translation: AcmeDemoBundle #(Optional) Change the translation domain, default : EBFacebookBundle
        culture: en_EN #(Optional) Facebook language, default : fr_FR

    ```

    If you have configured the fixcookie url, add to the web folder, the following PHP script

    ```
    // web/fixcookie.php
