proxitok/app/Controllers/MusicController.php

23 lines
585 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;
use App\Helpers\Wrappers;
2022-01-30 18:02:52 -05:00
use App\Models\FeedTemplate;
class MusicController {
static public function get(string $music_id) {
$cursor = Misc::getCursor();
$api = Wrappers::api();
2022-01-30 18:02:52 -05:00
$feed = $api->getMusicFeed($music_id, $cursor);
if ($feed->meta->success) {
$latte = Wrappers::latte();
2022-01-30 18:02:52 -05:00
$latte->render(Misc::getView('music'), new FeedTemplate('Music', $feed));
} else {
ErrorHandler::show($feed->meta);
}
}
}