// app/ApplicationKernel.php
public function registerBundles()
{
return array(
// ...
new FOS\FacebookBundle\FOSFacebookBundle(),
new FOS\UserBundle\FOSUserBundle(),
new EB\FacebookBundle\EBFacebookBundle(),
// ...
);
}
Add the following routes to your application and point them at actual controller actions, (*4)
Configure the eb_facebook service in your config:, (*5)
#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, (*6)
Create the action for the game view in your controller, you have to name your route "game", (*29)
// src/Acme/DemoBundle/Controller/DemoController.php
class DemoController extends Controller
{
/**
* @Route("/game", name="game") //You have to name your route "game"
* @Template()
*/
public function gameAction()
{
/*
Some code
*/
return array(
);
}
}