ss/twitter-bundle

Symfony TwitterBundle

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-master 2016-01-29 16:21 UTC

This package is not auto-updated.

Last update: 2020-01-10 15:44:41 UTC


README

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

    $ composer require ss/twitter-bundle "*@dev" -dev

This command requires you to have Composer installed globally, as explained in the installation chapter_ of the Composer documentation.

Step 1: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

<?php
    // app/AppKernel.php
    class AppKernel extends Kernel
    {
        public function registerBundles()
        {
            $bundles = array(
                // ...
                new SS\TwitterBundle\SSTwitterBundle(),
            );
            // ...
        }
    }

Step 4: Configure your application's config.yml

Below is the configuration necessary to use the SSTwitterBundle in your application:

    # app/config/config.yml
    parameters:
        twitter_api.key: YOUR_CONSUMER_KEY
        twitter_api.key_secret: YOUR_CONSUMER_SECRET

        

Step 5: How to use :

You should call the ss_twitter_api service, this is an exemple on controller :

<?php
    /**
     * @Route("/app/hometimeline", name="hometimeline")
     */
    public function indexAction()
    {
        $twitter = $this->get('ss_twitter_api');
        $twitter_object = $twitter->getUserTimeLine('salemsaiid',10);
        
        return $this->render('AppBundle:Default:index.html.twig', array(
            'twitter_object' => $twitter_object
        ));
    }