2017-25 © Pedro Peláez
 

library twitter-widgets

PHP library that helps rendering twitter embedded timelines

image

mpalourdio/twitter-widgets

PHP library that helps rendering twitter embedded timelines

  • Saturday, April 8, 2017
  • by mpalourdio
  • Repository
  • 1 Watchers
  • 0 Stars
  • 569 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1 % Grown

The README.md

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight PHP 7.0+ MIT Licensed, (*1)

TwitterWidgets

PHP library that helps rendering twitter embedded timelines, (*2)

Requirements

PHP 7.0+ - Only Composer installation supported, (*3)

Installation

Run the command below to install via Composer, (*4)

composer require mpalourdio/twitter-widgets

Usage

$widgetOptions = new WidgetOptions($options);
$userTimeline  = new TimelineBuilder($widgetOptions);
echo $userTimeline->renderWidget();

$options can handle these parameters : https://dev.twitter.com/web/embedded-timelines#options, (*5)

Their PHP equivalent as array keys to use in the $options array are :, (*6)

'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',

The TimelineBuilder#renderWidget() method accepts a boolean to disable the javascript code added to each widget. Useful if you have more that one widget to avoid JS overhead., (*7)

When disabled, to add only once the needed javascript to your HTML code, use OneTimeJsProvider#getOneTimeWidgetJs() just before your </body>, (*8)

More information here : https://dev.twitter.com/web/javascript/loading, (*9)

ZF2

A ZF2 view helper is available here : https://github.com/mpalourdio/zf2-twitter-widget, (*10)

TWIG

A twig extension is available here : https://github.com/mpalourdio/TwitterWidgetBundle, (*11)

The Versions

08/04 2017

dev-master

9999999-dev https://github.com/mpalourdio/TwitterWidgets

PHP library that helps rendering twitter embedded timelines

  Sources   Download

MIT

The Requires

 

The Development Requires

widget twitter timeline

08/04 2017

0.2.0

0.2.0.0 https://github.com/mpalourdio/TwitterWidgets

PHP library that helps rendering twitter embedded timelines

  Sources   Download

MIT

The Requires

 

The Development Requires

widget twitter timeline

06/12 2014

0.1.2

0.1.2.0 https://github.com/mpalourdio/TwitterWidgets

PHP library that helps rendering twitter embedded timelines

  Sources   Download

MIT

The Requires

 

The Development Requires

widget twitter timeline

22/10 2014

0.1.1

0.1.1.0 https://github.com/mpalourdio/TwitterWidgets

PHP library that helps rendering twitter embedded timelines

  Sources   Download

MIT

The Requires

 

The Development Requires

widget twitter timeline

06/10 2014

0.1.0

0.1.0.0 https://github.com/mpalourdio/TwitterWidgets

PHP library that helps rendering twitter embedded timelines

  Sources   Download

MIT

The Requires

 

The Development Requires

widget twitter timeline