proxitok/app/Controllers/MusicController.php
2022-05-24 14:10:41 +02:00

25 lines
636 B
PHP

<?php
namespace App\Controllers;
use App\Helpers\ErrorHandler;
use App\Helpers\Misc;
use App\Helpers\Wrappers;
use App\Models\FullTemplate;
class MusicController {
static public function get(string $music_id) {
$cursor = Misc::getCursor();
$api = Wrappers::api();
$music = $api->music($music_id);
$music->feed($cursor);
if ($music->ok()) {
$data = $music->getFull();
$latte = Wrappers::latte();
$latte->render(Misc::getView('music'), new FullTemplate('Music', $data));
} else {
ErrorHandler::show($music->error());
}
}
}