Git Product home page Git Product logo

yii2-telex's Introduction

Yii2-telex 2.1

Telex news scroller widget for the Yii2 PHP Framework

Latest Stable Version Total Downloads License

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.

A demonstration of Yii2-telex is here.

Installation

Install Yii2-telex with Composer. Either add the following to the require section of your composer.json file:

"sjaakp/yii2-telex": "*"

Or run:

composer require sjaakp/yii2-telex "*"

You can manually install Yii2-telex by downloading the source in ZIP-format.

Using Yii2-telex

Options

Yii2-telex has the following options:

  • 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.

yii2-telex's People

Contributors

sjaakp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yii2-telex's Issues

Can't install using composer

After issuing $ composer require sjaakp/yii2-telex "*"
I got error:

[InvalidArgumentException]
Could not find package yii.bat at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

My composer.json is:

{
    "name": "gitowiec/egpd",
    "description": "",
    "keywords": [""],
    "homepage": "",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": ""
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": ">=2.0.6",
        "yiisoft/yii2-bootstrap": ">=2.0.6",
        "yiisoft/yii2-swiftmailer": ">=2.0.5",
        "dektrium/yii2-user": "0.9.*@dev",
        "dektrium/yii2-rbac": "dev-master",
        "petrgrishin/yii2-array-field": "~2.0"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "vendor-dir": "../vendor",
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "../vendor/npm",
            "bower-asset-library": "../vendor/bower"
        }
    }
}

OK ok, but $ composer require sjaakp/yii2-telex "1.0" works, so it is not a bug? :)

Getting error using Telex

ReflectionException
Class yii\jui\JuiAsset does not exist

1. in /var/www/html/yii2atest03/vendor/yiisoft/yii2/di/Container.php at line 415
406407408409410411412413414415416417418419420421422423424

     * @return array the dependencies of the specified class.
     */
    protected function getDependencies($class)
    {
        if (isset($this->_reflections[$class])) {
            return [$this->_reflections[$class], $this->_dependencies[$class]];
        }

        $dependencies = [];
        $reflection = new ReflectionClass($class);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.