Skip to content

Commit

Permalink
Add RuTube widget
Browse files Browse the repository at this point in the history
  • Loading branch information
ElisDN committed Oct 3, 2024
1 parent bf92f2e commit 76317f5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use app\modules\edu\widgets\SeriesEpisodes;
use app\widgets\inline\CountDown;
use app\widgets\inline\MailTo;
use app\widgets\inline\RuTube;
use app\widgets\inline\SubscribeNews;
use app\widgets\inline\SubscribeWebinars;
use app\widgets\inline\YouTube;
Expand Down Expand Up @@ -230,6 +231,7 @@
'lastPosts' => LastPostsWidget::class,
'block' => BlockWidget::class,
'countdown' => CountDown::class,
'rutube' => RuTube::class,
'youtube' => YouTube::class,
'subscribe_webinars' => SubscribeWebinars::class,
'subscribe_news' => SubscribeNews::class,
Expand Down
19 changes: 19 additions & 0 deletions src/widgets/inline/RuTube.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace app\widgets\inline;

use yii\base\Widget;

final class RuTube extends Widget
{
public string $id = '';

public function run(): string
{
return $this->render('RuTube', [
'id' => $this->id,
]);
}
}
13 changes: 13 additions & 0 deletions src/widgets/inline/views/RuTube.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php declare(strict_types=1);

use yii\helpers\Html;

/** @var string $id */
?>
<iframe
width="680"
height="382"
src="https://rutube.ru/play/embed/<?= Html::encode($id); ?>"
allow="accelerometer; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

0 comments on commit 76317f5

Please sign in to comment.