Added radio page
This commit is contained in:
@@ -131,8 +131,25 @@ class Controller extends BaseController
|
||||
public function __call($method, $arguments) {
|
||||
if(substr($method, 0, 5) == 'view_') {
|
||||
$view = substr($method, 5);
|
||||
if(view()->exists($view)) { return view($view); }
|
||||
if(view()->exists($view)) { return view($view, $this->getSidebareData()); }
|
||||
}
|
||||
return abort(404);
|
||||
}
|
||||
|
||||
public function getSidebareData()
|
||||
{
|
||||
$populair = [];
|
||||
$apiResult = $this->API('nieuws/populair?aantal=5');
|
||||
foreach ($apiResult as $_newsItem) {
|
||||
$populair[] = new \Model\NewsItem($_newsItem);
|
||||
}
|
||||
|
||||
$newsItems = [];
|
||||
$apiResult = $this->API('nieuws/overzicht?aantal=5');
|
||||
foreach ($apiResult->news as $_newsItem) {
|
||||
$newsItems[] = new \Model\NewsItem($_newsItem);
|
||||
}
|
||||
|
||||
return ['newsItems' => $newsItems, 'populair' => $populair];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user