PHPackages                             dynamikaweb/yii2-youtube - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dynamikaweb/yii2-youtube

ActiveYii2-extension[API Development](/categories/api)

dynamikaweb/yii2-youtube
========================

environment for use with youtube, has validators, helpers, apis, widgets...

v1.1.1(4y ago)01.2k↓75%BSD-3-ClausePHP

Since Apr 29Pushed 4y agoCompare

[ Source](https://github.com/dynamikaweb/yii2-youtube)[ Packagist](https://packagist.org/packages/dynamikaweb/yii2-youtube)[ RSS](/packages/dynamikaweb-yii2-youtube/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

dynamikaweb/yii2-youtube
========================

[](#dynamikawebyii2-youtube)

[![Latest Stable Version](https://camo.githubusercontent.com/027aa26c6f6557a09407eb9525c3a86f1495ca5e766e03656e8594af38072347/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f64796e616d696b617765622f796969322d796f7574756265)](https://github.com/dynamikaweb/yii2-youtube/releases)[![Total Downloads](https://camo.githubusercontent.com/a3d24464bd533bf02797e886f8b0d561f1b2215e32f1539d14944f805a615957/68747470733a2f2f706f7365722e707567782e6f72672f64796e616d696b617765622f796969322d796f75747562652f646f776e6c6f616473)](https://packagist.org/packages/dynamikaweb/yii2-youtube)[![License](https://camo.githubusercontent.com/2be1261d53c1c77265c0d1b1b43e7270425f48b0e7e0dd3194ff01b803611146/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f64796e616d696b617765622f796969322d796f7574756265)](https://github.com/dynamikaweb/yii2-youtube/blob/master/LICENSE)[![Codacy Badge](https://camo.githubusercontent.com/f49d01efcee06a5fe1b74824f1e8672efdce961d1bc065986fb205bfa184279d/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3536343661633437323737363434323962613761643861663732613736653331)](https://www.codacy.com/gh/dynamikaweb/yii2-youtube/dashboard?utm_source=github.com&utm_medium=referral&utm_content=dynamikaweb/yii2-youtube&utm_campaign=Badge_Grade)[![Build Test](https://camo.githubusercontent.com/834ae759870e60aaad7357a47f7ee517f96db61c4a3b36ec354fdb8409733914/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64796e616d696b617765622f796969322d796f75747562652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dynamikaweb/yii2-youtube/)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ composer require dynamikaweb/yii2-youtube "*"
```

or add

```
"dynamikaweb/yii2-youtube": "*"
```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

Add it to your components

### add to your components

[](#add-to-your-components)

```
'components' => [
    ...
    'youtube' => [
        'class' => \sr1871\youtubeApi\components\YoutubeApi::className(),
        'api_config' => [
            'clientId' => 'your Oauth Client Id, you can get it from google console',
            'clientSecret' => 'your Oauth Client Secret, you can get it from google console',
            'scopes' => ['scopes that you going to use', 'as array'],
        ],
        'channel' = 'youtube channel, which will be consulted'
    ],
    ...
]
```

### generate your access token

[](#generate-your-access-token)

An advantage of this component is that you only have to generate your access token once.

Create an action in any controller

```
public function actionYoutubeValidation() {
    if(Yii::$app->request->get('validate')){
        return $this->redirect(Yii::$app->youtube->validationGet(Yii::$app->urlManager->createAbsoluteUrl('/site/youtube-validation')));
    }

    if(Yii::$app->request->get('code')){
        Yii::$app->youtube->validationPost(Yii::$app->urlManager->createAbsoluteUrl('/site/youtube-validation'));
    } else {
        Yii::$app->session->setFlash('success', 'The access token was generated');
        return $this->redirect('index');
    }
}
```

To validate access to the action by passing the `validate` parameter come true. This will access google to do the validation and it will return to the same action by passing the parameter `code` with the` Access Token`.

#### Example:

[](#example)

### Example

[](#example-1)

```
Yii::$app->youtube->setParts(['snippet', 'recordingDetails', 'id'])->listVideos(['id' => 'someId'])
```

You can pass in `setParts()`, the parts that you want, if you don't want the default parts. For more information of every method and how do it, read the PhpDOC of component's methods

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

3

Last Release

1820d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29123479?v=4)[DornellesTV](/maintainers/RodrigoDornelles)[@RodrigoDornelles](https://github.com/RodrigoDornelles)

---

Top Contributors

[![RodrigoDornelles](https://avatars.githubusercontent.com/u/29123479?v=4)](https://github.com/RodrigoDornelles "RodrigoDornelles (2 commits)")

---

Tags

youtubeyii2yiidynamika

### Embed Badge

![Health badge](/badges/dynamikaweb-yii2-youtube/health.svg)

```
[![Health](https://phpackages.com/badges/dynamikaweb-yii2-youtube/health.svg)](https://phpackages.com/packages/dynamikaweb-yii2-youtube)
```

###  Alternatives

[monitorbacklinks/yii2-wordpress

Yii2 component for integration with Wordpress CMS via XML-RPC API

3326.9k](/packages/monitorbacklinks-yii2-wordpress)[baibaratsky/yii2-ga-measurement-protocol

Google Analytics Measurement Protocol for Yii2

13104.2k](/packages/baibaratsky-yii2-ga-measurement-protocol)[sonko-dmitry/yii2-telegram-bot-api

Telegram bot api component for Yii2

2132.2k](/packages/sonko-dmitry-yii2-telegram-bot-api)[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1243.1k1](/packages/skeeks-yii2-google-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
