Skip to content

Commit

Permalink
видео плеер
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Karachev committed Oct 17, 2024
1 parent c5e3495 commit 0fd817f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 6 additions & 1 deletion backend/views/video/file/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
use backend\models\video\VideoSource;
use backend\widgets\grid\DeleteButton;
use backend\widgets\grid\UpdateButton;
use backend\widgets\grid\ViewButton;
use backend\widgets\WikidsDatePicker;
use common\models\SlideVideo;
use yii\bootstrap\Dropdown;
use yii\bootstrap\Nav;
use yii\data\DataProviderInterface;
Expand Down Expand Up @@ -54,8 +56,11 @@
],
[
'class' => ActionColumn::class,
'template' => '{update} {delete}',
'template' => '{view} {update} {delete}',
'buttons' => [
'view' => static function($url, SlideVideo $model): string {
return (new ViewButton(Yii::$app->urlManagerFrontend->createAbsoluteUrl(['/video/view', 'id' => $model->uuid])))();
},
'update' => static function($url, $model) {
return (new UpdateButton(['video/file/update', 'id' => $model->id]))();
},
Expand Down
8 changes: 4 additions & 4 deletions backend/widgets/grid/ViewButton.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

declare(strict_types=1);

namespace backend\widgets\grid;

class ViewButton extends Button
{

public function __invoke(array $options = [])
public function __invoke(array $options = []): string
{
return $this->createButton('eye-open', 'Просмотр', $options);
}

}
}
2 changes: 2 additions & 0 deletions common/config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
'study/task/<id:\d+>' => 'study/task',
'<section:\w+>' => 'story/index',
'/edu/story/<id:\d+>' => 'edu/story/view',
'/learning-path/<id:[A-Za-z0-9_-]+>' => 'learning-path/default/index',
'/video/player/<id>' => 'video/view',
],
],

Expand Down

0 comments on commit 0fd817f

Please sign in to comment.