PHPackages                             mpalourdio/twitter-widget-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. mpalourdio/twitter-widget-bundle

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

mpalourdio/twitter-widget-bundle
================================

Simple bundle to easily display twitter timelines widgets in twig views

0.2.0(9y ago)052MITPHPPHP ^7.0

Since Oct 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mpalourdio/TwitterWidgetBundle)[ Packagist](https://packagist.org/packages/mpalourdio/twitter-widget-bundle)[ Docs](https://github.com/mpalourdio/TwitterWidgetBundle)[ RSS](/packages/mpalourdio-twitter-widget-bundle/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (7)Versions (6)Used By (0)

[![Build Status](https://camo.githubusercontent.com/cb8ebd0998c5575cfa1a2b64df3c9a9fa8268d73434b21a3245f87d260dddd25/68747470733a2f2f7472617669732d63692e6f72672f6d70616c6f757264696f2f5477697474657257696467657442756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mpalourdio/TwitterWidgetBundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c8bef903237489dbc8446cb8051115a486505b5252c08d9479826a66596ef9b5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d70616c6f757264696f2f5477697474657257696467657442756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mpalourdio/TwitterWidgetBundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c4eba21388b7966b3decb3830c9bdddef620648f52c2ac429a27928096a37c54/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d70616c6f757264696f2f5477697474657257696467657442756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mpalourdio/TwitterWidgetBundle/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/df9dd5fe204eea0e89e6c5494d57d5ee8bf2e67b47ac2671235b661bfc3651dd/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35356364663663342d626463622d343233612d626433652d3230646461336638616431332f6d696e692e706e67)](https://insight.sensiolabs.com/projects/55cdf6c4-bdcb-423a-bd3e-20dda3f8ad13)[![PHP 7.0+](https://camo.githubusercontent.com/661ec2b3805144b308f076cd3a7324daf1050bb3608c286ed3e0d49df1c3b03b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e302b2d3838393242462e737667)](http://php.net)[![MIT Licensed](https://camo.githubusercontent.com/7bb7f9228d9997f09c313c4364647ef637486acd002aae26119a4e2cbf0ee808/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61646c6177736f6e2f766576616c2e737667)](LICENSE)

TwitterWidgetBundle
===================

[](#twitterwidgetbundle)

Twig extension to easily display twitter embedded timelines widgets in Symfony project. Based on this library :

Requirements
============

[](#requirements)

PHP 7.0+ - Only Composer installation supported

Installation
============

[](#installation)

Run the command below to install via Composer

```
composer require mpalourdio/twitter-widget-bundle
```

Add `new TwitterWidgetBundle\TwitterWidgetBundle()` to your **AppKernel.php**

Usage
=====

[](#usage)

- 1. Create a timeline widget here :
- 2. In the javascript generated code, get the URL and the data-widget-id (minimum information required)
- 3. Finally, in a twig template, use as following:

```
{{
  tw({
         'dataWidgetId' : '1245687955000', => the id must be a string (quotes), because of long integer converted to float
         'href'         : 'https://twitter.com/NickName',
         'hrefText'     : 'Here type a title'
     },
     true/false
}}
```

All the following options are handled :

Their PHP equivalent as array keys to use in the twig function are :

```
'class'           => 'A css class, by default it will be twitter-timeline',
'href'            => 'The link to the timeline',
'hrefText'        => 'A title for your timeline to display',
'dataWidgetId'    => 'Your data widget ID : must be a string (!)',
'dataTheme'       => 'ex: dark',
'dataLinkColor'   => 'ex: #cc0000',
'width'           => 300 (integer),
'height'          => 400 (integer),
'dataChrome'      => 'noheader nofooter noborders noscrollbar transparent', => a string with options separated by a single space
'dataBorderColor' => 'border color used by the widget',
'language'        => 'The widget language detected from the page, based on the HTML lang attribute of your content. You can also set the HTML lang attribute on the embed code itself.',
'dataTweetLimit'  => 20,
'dataRelated'     => 'benward,endform',
'dataAriaPolite'  => 'polite or assertive',
```

You can give an instance of `TwitterWidgets\Options\WidgetOptions` instead of an array (or any implementation of `TwitterWidgets\Timeline\WidgetOptionsInterface`).

```
$options = new TwitterWidgets\Options\WidgetOptions();
$options->setDataWidgetId('1245687955000');
$options->setHref('https://twitter.com/NickName');
$options->setHrefText('Here type a title');

{{ tw(options) }}
```

The function second parameter is a boolean (true by default), that indicates if you must render the javascript code for your widget. If you have more that one widget on your page, use the `OneTimeJs` extension to only add once the javascript code, just before your ``. This will avoid some overhead. See

```
{% block javascripts %}
        {{ twJs() }}
{% endblock %}
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~305 days

Total

4

Last Release

3372d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.5

0.2.0PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4fdbda774ff506689d09a6030ea897b292188db54d9edb53af8289d8313e9da8?d=identicon)[mpalourdio](/maintainers/mpalourdio)

---

Top Contributors

[![mpalourdio](https://avatars.githubusercontent.com/u/5034671?v=4)](https://github.com/mpalourdio "mpalourdio (51 commits)")[![BitcoinMitchell](https://avatars.githubusercontent.com/u/27309467?v=4)](https://github.com/BitcoinMitchell "BitcoinMitchell (2 commits)")

---

Tags

bundlesymfonysymfony-bundlesymfony3symfony3-bundletimeline-widgettwigtwig-extensiontwittersymfonytwigtwitterwidgettimeline

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mpalourdio-twitter-widget-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/mpalourdio-twitter-widget-bundle/health.svg)](https://phpackages.com/packages/mpalourdio-twitter-widget-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
