Liveblog - start work
This commit is contained in:
@@ -9,22 +9,25 @@ class HomeController extends Controller
|
||||
{
|
||||
public function show(Request $request)
|
||||
{
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
$apiResult = $this->API('nieuws/overzicht?pagina=' . (int)max(1, $page) . '&aantal=10');
|
||||
$page = (int) $request->get('pagina', 1);
|
||||
$apiResult = $this->API('nieuws/overzicht?pagina=' . (int) max(1, $page) . '&aantal=10');
|
||||
$news = [];
|
||||
foreach ($apiResult->news as $newsItem) {
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
}
|
||||
|
||||
$apiResult = $this->API('nieuws/liveblogs');
|
||||
$liveblogs = $apiResult->liveblogs;
|
||||
|
||||
$populair = [];
|
||||
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=5');
|
||||
$apiResult = $this->API('nieuws/populair?pagina=' . (int) max(1, $page) . '&aantal=5');
|
||||
foreach ($apiResult->news as $newsItem) {
|
||||
$populair[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
$apiResult = $this->API('podcast/overzicht?aantal=15');
|
||||
$index = array_rand($apiResult->podcasts);
|
||||
$apiResult = $this->API('podcast/overzicht?aantal=15');
|
||||
$index = array_rand($apiResult->podcasts);
|
||||
$podcast = new \Model\Podcast($apiResult->podcasts[$index]);
|
||||
return view('home', ['populair' => $populair, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
|
||||
return view('home', ['populair' => $populair, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'liveblogs' => $liveblogs, 'searchURL' => 'nieuws/zoeken']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user