tuyakhov/yii2-youtube

Yii2 youtube extension

Installs: 6 232

Dependents: 0

Suggesters: 0

Security: 0

Stars: 11

Watchers: 2

Forks: 4

Open Issues: 0

Type:yii2-extension

v1.0.0 2015-04-01 15:15 UTC

This package is auto-updated.

Last update: 2024-03-29 03:31:28 UTC


README

Yii2 youtube extension

Scrutinizer Code Quality Build Status Code Climate

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist tuyakhov/yii2-youtube "*"

or add

"tuyakhov/yii2-youtube": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

Widget

    \tuyakhov\youtube\EmbedWidget::widget([
        'code' => 'vs5ZF9fRDzA',
        'playerParameters' => [
            'controls' => 2
        ],
        'iframeOptions' => [
            'width' => '600',
            'height' => '450'
        ]
    ]);

Validator

    public function rules()
    {
        return [
            ['youtube_code', CodeValidator::className()],
        ];
    }