Balkje naar actief blog bovenaan

This commit is contained in:
2020-03-23 14:38:25 +01:00
parent d83e27813e
commit 843e66be6a
3 changed files with 20 additions and 9 deletions

View File

@@ -35,6 +35,12 @@ class Controller extends BaseController
{
View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/'));
View::share('imgBase', env('IMAGE_BASE_URL', '/'));
$blogs = $this->getDataFromFileAndConvert('blogs.json', [], '\Model\Blog', 1);
$activeBlog = count($blogs) && $blogs[0]->is_active ? $blogs[0] : null;
View::share('activeBlog', $activeBlog);
//View::share('onAir', file_get_contents(url('onair')));
View::composer('widgets.laatstenieuws', function($view) {
$view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'));
@@ -77,7 +83,6 @@ class Controller extends BaseController
});
View::composer('widgets.menu', function($view) {
$view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'))
->with('blogs', $this->getDataFromFileAndConvert('blogs.json', [], '\Model\Blog', 1))
->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\Model\NewsItem', 3))
->with('podcasts', $this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast'));
});