All Projects → tobiassjosten → FacebookServiceProvider

tobiassjosten / FacebookServiceProvider

Licence: MPL-2.0 License
Silex service provider that injects the Facebook SDK as a service

Programming Languages

PHP
23972 projects - #3 most used programming language

Labels

Projects that are alternatives of or similar to FacebookServiceProvider

Cache Service Provider
A Cache Service Provider for Silex, using the doctrine/cache package
Stars: ✭ 23 (-17.86%)
Mutual labels:  silex
Silex Webprofiler
Stars: ✭ 207 (+639.29%)
Mutual labels:  silex
PHP-Frameworks-Bench
Popular PHP Frameworks Benchmark.
Stars: ✭ 28 (+0%)
Mutual labels:  silex
Silex
Silex is a static website builder in the cloud.
Stars: ✭ 958 (+3321.43%)
Mutual labels:  silex
Payumserver
Payment processing microservice. Written in Symfony4
Stars: ✭ 103 (+267.86%)
Mutual labels:  silex
Pimple
A small PHP dependency injection container
Stars: ✭ 2,491 (+8796.43%)
Mutual labels:  silex
Silex Kitchen Edition
This project is a sample or a bootstrap silex application
Stars: ✭ 645 (+2203.57%)
Mutual labels:  silex
ResponsibleServiceProvider
Silex service provider for seamless HTTP content negotiation
Stars: ✭ 35 (+25%)
Mutual labels:  silex
Php Getting Started
Getting Started with PHP on Heroku
Stars: ✭ 170 (+507.14%)
Mutual labels:  silex
sm-groupcheck-web
GroupCheck web API.
Stars: ✭ 14 (-50%)
Mutual labels:  silex
Silex
something to help you spark
Stars: ✭ 61 (+117.86%)
Mutual labels:  silex
Crudlex
CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages
Stars: ✭ 102 (+264.29%)
Mutual labels:  silex
Slugify
Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
Stars: ✭ 2,697 (+9532.14%)
Mutual labels:  silex
Silexstarter
Starter app based on Silex framework with mvc and modular arch, scaffold generator, and admin panel
Stars: ✭ 11 (-60.71%)
Mutual labels:  silex
silex-starter-pack
A starter pack for beginning development with the Silex PHP framework. Includes a basic admin control panel, and user login system.
Stars: ✭ 12 (-57.14%)
Mutual labels:  silex
Silex Skeleton
A skeleton to get started with Silex
Stars: ✭ 805 (+2775%)
Mutual labels:  silex
Transport
Swiss public transport API
Stars: ✭ 215 (+667.86%)
Mutual labels:  silex
silex-example
silex-example.pagodabox.com/
Stars: ✭ 13 (-53.57%)
Mutual labels:  silex
hello-world-app-php-silex
Hello World sample app in PHP and Silex
Stars: ✭ 23 (-17.86%)
Mutual labels:  silex
silex-ddd-skeleton
A simple skeleton of silex application using ddd arquitecture
Stars: ✭ 19 (-32.14%)
Mutual labels:  silex

Facebook Service Provider for Silex

Silex Service Provider for loading the Facebook SDK into your apps.

Build Status Dependencies

Installation

FacebookServiceProvider uses Composer, which makes installing it dead simple.

1 -- Download Composer as per the instructions.

2 -- Add FacebookServiceProvider to the requirements of your composer.json.

"require": {
    "php": "> 5.3.2",
    "tobiassjosten/facebook-service-provider": "dev-master"
}

(See a full example of FacebookServiceProvider's composer.json.)

3 -- Run ./composer.phar install

And that's it! You now have FacebookServiceProvider installed into your vendor directory. Inside which an autoloader file has also been created for you.

Usage

Next you need to tell the autoloader where to look for the Tobiassjosten\Silex\Provider\Facebook namespace.

$app['autoloader']->registerNamespaces(array(
    'Tobiassjosten\Silex\Provider' => __DIR__.'/vendor/tobiassjosten/facebook-service-provider/lib',
));

$app->register(new Tobiassjosten\Silex\Provider\FacebookServiceProvider(), array(
    'facebook.app_id'     => '1234567890',
    'facebook.secret'     => '7de6da38beb841a75f0ac5becb215f18',
));

Now Silex knows all it needs and you can use the Facebook SDK in your application.

$app->get('/about', function() use ($app) {
    $tobias = $app['facebook']->api('/721814015');

    return "Brought to you by {$tobias['name']}!";
});

Tests

Again because of Composer, running tests are dead simple.

$ ./composer.phar install && phpunit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].