proxitok/app/Controllers/VideoController.php

20 lines
504 B
PHP
Raw Normal View History

2022-01-30 18:02:52 -05:00
<?php
namespace App\Controllers;
use App\Helpers\ErrorHandler;
use App\Helpers\Misc;
2022-03-11 17:39:56 -05:00
use App\Models\FeedTemplate;
2022-01-30 18:02:52 -05:00
class VideoController {
static public function get(string $video_id) {
$api = Misc::api();
2022-03-11 17:39:56 -05:00
$feed = $api->getVideoByID($video_id);
if ($feed->meta->success) {
2022-01-30 18:02:52 -05:00
$latte = Misc::latte();
2022-03-11 17:39:56 -05:00
$latte->render(Misc::getView('video'), new FeedTemplate('Video', $feed));
2022-01-30 18:02:52 -05:00
} else {
2022-03-11 17:39:56 -05:00
ErrorHandler::show($feed->meta);
2022-01-30 18:02:52 -05:00
}
}
}