Patching system, video by id
This commit is contained in:
parent
38fa75402b
commit
c6b0f1e812
19 changed files with 305 additions and 60 deletions
|
|
@ -10,6 +10,11 @@ Route::add('/', function () {
|
|||
$latte->render(Misc::getView('home'));
|
||||
});
|
||||
|
||||
Route::add('/about', function () {
|
||||
$latte = Misc::latte();
|
||||
$latte->render(Misc::getView('about'));
|
||||
});
|
||||
|
||||
Route::add("/trending", function () {
|
||||
$cursor = 0;
|
||||
if (isset($_GET['cursor']) && is_numeric($_GET['cursor'])) {
|
||||
|
|
@ -44,6 +49,17 @@ Route::add("/@([^/]+)", function (string $username) {
|
|||
}
|
||||
});
|
||||
|
||||
Route::add('/video/(\d+)', function (string $video_id) {
|
||||
$latte = Misc::latte();
|
||||
$api = Misc::api();
|
||||
$item = $api->getVideoByID($video_id);
|
||||
if ($item) {
|
||||
$latte->render(Misc::getView('video'), ['item' => $item]);
|
||||
} else {
|
||||
return 'ERROR!';
|
||||
}
|
||||
});
|
||||
|
||||
Route::add('/tag/(\w+)', function (string $name) {
|
||||
$cursor = 0;
|
||||
if (isset($_GET['cursor']) && is_numeric($_GET['cursor'])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue