Yii2-telex 2.1
, (*1)
Telex widget is a widget to render my Javascript telex widget. It displays horizontal scrolling news messages, traffic information, stock quotes, and the like, provided by a Yii2 DataProvider., (*2)
A demonstration of Yii2-telex is here., (*3)
Installation
Install Yii2-telex with Composer. Either add the following to the require section of your composer.json file:, (*4)
"sjaakp/yii2-telex": "*", (*5)
Or run:, (*6)
composer require sjaakp/yii2-telex "*", (*7)
You can manually install Yii2-telex by downloading the source in ZIP-format., (*8)
Using Yii2-telex
Options
Yii2-telex has the following options:, (*9)
-
dataProvider: instance of a
yii\data\DataProviderInterface providing BaseObjects with message data.
-
bodyAttribute: attribute name of the attribute of the message's body text. The body text may contain HTML. Default:
"body".
-
styleAttribute: attribute name of the style attribute (optional). This attribute will be prefixed with stylePrefix to form the HTML-class of the message. Default:
"style".
-
urlAttribute: attribute name of the url attribute (optional). If set, the message will be a link to the url. Default:
"url".
-
stylePrefix: see styleAttribute. Default:
"telex-".
-
options: array of options for the underlying Javascript telex widget. More information here.
-
htmlOptions: array of HTML options for the Telex container. Use this if you want to explicitly set the ID.
Overridable
Yii2-telex's protected function prepareBody($str) can be overridden. To manipulate the body text before it is sent to the widget.
The default implementation just returns $str., (*10)