2022-02-05 18:58:30 -05:00
|
|
|
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
|
|
|
|
use App\Helpers\ErrorHandler;
|
|
|
|
use App\Helpers\Misc;
|
2022-02-13 16:21:08 -05:00
|
|
|
use App\Models\DiscoverTemplate;
|
2022-02-05 18:58:30 -05:00
|
|
|
|
|
|
|
class DiscoverController {
|
|
|
|
static public function get() {
|
|
|
|
$api = Misc::api();
|
|
|
|
$feed = $api->getDiscover();
|
|
|
|
if ($feed->meta->success) {
|
|
|
|
$latte = Misc::latte();
|
2022-02-13 16:21:08 -05:00
|
|
|
$latte->render(Misc::getView('discover'), new DiscoverTemplate($feed));
|
2022-02-05 18:58:30 -05:00
|
|
|
} else {
|
|
|
|
ErrorHandler::show($feed->meta);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|