dev-master
9999999-devSymfony TwitterBundle
GPL-3.0+
The Requires
by Salem Said
api twitter application
Wallogit.com
2017 © Pedro Peláez
Symfony TwitterBundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*1)
$ 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., (*2)
Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your project:, (*3)
<?php
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new SS\TwitterBundle\SSTwitterBundle(),
);
// ...
}
}
Below is the configuration necessary to use the SSTwitterBundle in your application:, (*4)
# app/config/config.yml parameters: twitter_api.key: YOUR_CONSUMER_KEY twitter_api.key_secret: YOUR_CONSUMER_SECRET
You should call the ss_twitter_api service, this is an exemple on controller :, (*5)
<?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
));
}
Symfony TwitterBundle
GPL-3.0+
api twitter application