{"id":16429863,"url":"https://github.com/mpalourdio/zf2-twitter-widget","last_synced_at":"2025-06-15T10:06:48.677Z","repository":{"id":21417900,"uuid":"24735974","full_name":"mpalourdio/zf2-twitter-widget","owner":"mpalourdio","description":"ZF2 view helper to easily display twitter timelines widgets","archived":false,"fork":false,"pushed_at":"2018-12-29T09:12:40.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T08:18:00.426Z","etag":null,"topics":["module","twitter","twitter-widget","zend-framework","zf2","zf2-module"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpalourdio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-02T20:46:46.000Z","updated_at":"2018-12-29T09:12:42.000Z","dependencies_parsed_at":"2022-08-21T08:41:08.519Z","dependency_job_id":null,"html_url":"https://github.com/mpalourdio/zf2-twitter-widget","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/mpalourdio/zf2-twitter-widget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2Fzf2-twitter-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2Fzf2-twitter-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2Fzf2-twitter-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2Fzf2-twitter-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpalourdio","download_url":"https://codeload.github.com/mpalourdio/zf2-twitter-widget/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpalourdio%2Fzf2-twitter-widget/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259957156,"owners_count":22937539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["module","twitter","twitter-widget","zend-framework","zf2","zf2-module"],"created_at":"2024-10-11T08:24:43.723Z","updated_at":"2025-06-15T10:06:48.510Z","avatar_url":"https://github.com/mpalourdio.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/mpalourdio/zf2-twitter-widget.svg?branch=master)](https://travis-ci.org/mpalourdio/zf2-twitter-widget)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mpalourdio/zf2-twitter-widget/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mpalourdio/zf2-twitter-widget/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/mpalourdio/zf2-twitter-widget/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/mpalourdio/zf2-twitter-widget/?branch=master)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/e3049656-58e8-406e-b85a-48e2c79d81df/mini.png)](https://insight.sensiolabs.com/projects/e3049656-58e8-406e-b85a-48e2c79d81df)\n[![PHP 7.0+][ico-engine]][lang]\n[![MIT Licensed][ico-license]][license]\n\n[ico-engine]: http://img.shields.io/badge/php-7.0+-8892BF.svg\n[lang]: http://php.net\n[ico-license]: http://img.shields.io/packagist/l/adlawson/veval.svg\n[license]: LICENSE\n\nzf2-twitter-widget\n==================\n\nZF2 view helper to easily display twitter embedded timelines widgets in a ZF2 project. Based on this library : https://github.com/mpalourdio/TwitterWidgets\n\nRequirements\n============\nPHP 7.0+ - Only Composer installation supported\n\nInstallation\n============\nRun the command below to install via Composer\n\n```shell\ncomposer require mpalourdio/zf2-twitter-widget\n```\n\nAdd \"ZfTwitterWidget\" to your **modules list** in **application.config.php**\n\nUsage\n=====\n- 1) Create a timeline widget here : https://twitter.com/settings/widgets/new\n- 2) In the javascript generated code, get the URL and the data-widget-id (minimum information required)\n- 3) Finally, in a view, use with \n\n```php\necho $this-\u003etw(\n        [\n            'dataWidgetId' =\u003e '1245687955000', =\u003e the id must be a string (quotes), because of long integer converted to float\n            'href'         =\u003e 'https://twitter.com/NickName',\n            'hrefText'     =\u003e 'Here type a title'\n        ],\n        true/false (true is default)\n    );\n```\n\nAll the following options are handled : https://dev.twitter.com/web/embedded-timelines#options\n\nTheir PHP equivalent as array keys to use in the view helper are  :\n\n```php\n'class'           =\u003e 'A css class, by default it will be twitter-timeline',\n'href'            =\u003e 'The link to the timeline',\n'hrefText'        =\u003e 'A title for your timeline to display',\n'dataWidgetId'    =\u003e 'Your data widget ID : must be a string (!)',\n'dataTheme'       =\u003e 'ex: dark',\n'dataLinkColor'   =\u003e 'ex: #cc0000',\n'width'           =\u003e 300 (integer),\n'height'          =\u003e 400 (integer),\n'dataChrome'      =\u003e 'noheader nofooter noborders noscrollbar transparent', =\u003e a string with options separated by a single space\n'dataBorderColor' =\u003e 'border color used by the widget',\n'language'        =\u003e '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.',\n'dataTweetLimit'  =\u003e 20,\n'dataRelated'     =\u003e 'benward,endform',\n'dataAriaPolite'  =\u003e 'polite or assertive',\n```\n\nYou can give an instance of ```TwitterWidgets\\Options\\WidgetOptions``` instead of an array (or any implementation of ```TwitterWidgets\\Timeline\\WidgetOptionsInterface```).\n\n```php\n$options = new TwitterWidgets\\Options\\WidgetOptions();\n$options-\u003esetDataWidgetId('1245687955000');\n$options-\u003esetHref('https://twitter.com/NickName');\n$options-\u003esetHrefText('Here type a title');\necho $this-\u003etw($options);\n```\n\nThe view helper 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,\nuse the ```OneTimeJsViewHelper``` to only add once the javascript code, just before your ```\u003c/body\u003e```. This will avoid some overhead. See https://dev.twitter.com/web/javascript/loading\n\n```php\n$this-\u003einlineScript()-\u003ecaptureStart();\necho $this-\u003etwJS();\n$this-\u003einlineScript()-\u003ecaptureEnd();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpalourdio%2Fzf2-twitter-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpalourdio%2Fzf2-twitter-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpalourdio%2Fzf2-twitter-widget/lists"}