Plaatjes gefixt en /nieuws/bericht/:id toegevoegd

This commit is contained in:
2017-06-07 08:27:50 +02:00
parent d6a90d8144
commit 3fa2b09eef
5 changed files with 574 additions and 10 deletions

View File

@@ -57,8 +57,10 @@ class NewsItem extends Model {
$this->source = $data->source ? new \Model\NewsSource($data->source, $data->source_url, $data->showsource) : null;
$this->keywords = trim($data->keywords) ? explode(' ', $data->keywords) : null;
$this->podcast = $data->podcast ? $data->podcast : null;
if($images = $images ?? $data->images) {
$images = ($images != null) ? $images
: (isset($data->images) ? $data->images : null);
if($images) {
$this->images = [];
foreach($images as $image) {
$this->images[] = new NewsImage($image, '/img/news/');