proxitok/app/Controllers/MusicController.php

25 lines
636 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-05-24 08:10:41 -04:00
use App\Models\FullTemplate;
2022-01-30 18:02:52 -05:00
class MusicController {
static public function get(string $music_id) {
$cursor = Misc::getCursor();
$api = Wrappers::api();
2022-05-24 08:10:41 -04:00
$music = $api->music($music_id);
$music->feed($cursor);
if ($music->ok()) {
$data = $music->getFull();
$latte = Wrappers::latte();
2022-05-24 08:10:41 -04:00
$latte->render(Misc::getView('music'), new FullTemplate('Music', $data));
2022-01-30 18:02:52 -05:00
} else {
2022-05-24 08:10:41 -04:00
ErrorHandler::show($music->error());
2022-01-30 18:02:52 -05:00
}
}
}