Skip to content

SalemSaiid/TwitterBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Step 1: Download the Bundle

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
        ));
    }

About

Small and easy Twitter bundle for Symfony Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages