proxitok/app/Controllers/MusicController.php

24 lines
586 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();
2022-11-04 15:08:19 -04:00
Wrappers::latte('music', new FullTemplate('Music', $data));
2022-01-30 18:02:52 -05:00
} else {
2022-09-03 08:01:03 -04:00
ErrorHandler::showMeta($music->error());
2022-01-30 18:02:52 -05:00
}
}
}