https://github.com/tuyakhov/yii2-youtube
Yii2 Youtube extension.
https://github.com/tuyakhov/yii2-youtube
Last synced: about 1 month ago
JSON representation
Yii2 Youtube extension.
- Host: GitHub
- URL: https://github.com/tuyakhov/yii2-youtube
- Owner: tuyakhov
- Created: 2015-03-22T08:52:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-23T07:31:19.000Z (almost 10 years ago)
- Last Synced: 2024-10-11T21:55:51.281Z (7 months ago)
- Language: PHP
- Size: 164 KB
- Stars: 12
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Yii2 youtube extension
======================
Yii2 youtube extension[](https://scrutinizer-ci.com/g/tuyakhov/yii2-youtube/?branch=master) [](https://scrutinizer-ci.com/g/tuyakhov/yii2-youtube/build-status/master) [](https://codeclimate.com/github/tuyakhov/yii2-youtube)
Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
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
```php
\tuyakhov\youtube\EmbedWidget::widget([
'code' => 'vs5ZF9fRDzA',
'playerParameters' => [
'controls' => 2
],
'iframeOptions' => [
'width' => '600',
'height' => '450'
]
]);
```Validator
```php
public function rules()
{
return [
['youtube_code', CodeValidator::className()],
];
}
```