flame / twitter-component
Nette Framework Control for rendering tweets.
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/flame/twitter-component
Requires
- php: >=5.3.2
- flame/framework: dev-master
- nette/nette: dev-master
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2025-10-25 19:41:08 UTC
README
About
TwitterControl is a simple but very powerful visual component for Nette Framework for displaying tweets on your site.
Installation
Preferred way of installation is using Composer.
Add the following dependency to your composer.json file and you're ready to go.
{
	"require": {
		"flame/twitter-component": "dev-master"
	}
}
Usage
In the config.neon
common:
	parameters:
		twitter:
			screenName: JSifalda
			tweetCount: 10
			...
services:
	Cache: Nette\Caching\Cache
	TwitterLoader: \Flame\Components\Twitter\TwitterLoader
		TwitterControlFactory:
			class: Flame\Components\Twitter\TwitterControlFactory
			setup:
				- setConfig(%twitter%)
### In presenter:
<?php /** * @var \Flame\Components\Twitter\TwitterControlFactory $twitterControlFactory */ private $twitterControlFactory; /** * @param \Flame\Components\Twitter\TwitterControlFactory $twitterControlFactory */ public function injectTwitterControlFactory(\Flame\Components\Twitter\TwitterControlFactory $twitterControlFactory) { $this->twitterControlFactory = $twitterControlFactory; } /** * @return \Flame\Components\Twitter\TwitterControl */ protected function createComponentTwitter() { return $this->twitterControlFactory->create(); }
###In template
{control twitter}
Available config options
screenName  Twitter screen name (either screenName or userId is required)
userId      Twitter user ID (takes precedence over screenName, if both specified)
tweetCount 		Number of tweets to load (max. 200)
retweets    Include retweets
replies     Include replies