Plaatjes gefixt en /nieuws/bericht/:id toegevoegd
This commit is contained in:
@@ -37,6 +37,10 @@ class Model {
|
||||
|
||||
public function url_slug($text) {
|
||||
$text = strtolower($text);
|
||||
// $text = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $text);
|
||||
$search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
|
||||
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
|
||||
$text = str_replace($search, $replace, $text);
|
||||
$text = preg_replace('/\b([a-z]{1,3})\b/u', '', $text);
|
||||
$text = preg_replace('/[^\w_\+\s]/', '', $text);
|
||||
$text = preg_replace('/\s+/', '-', $text);
|
||||
|
||||
@@ -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/');
|
||||
|
||||
Reference in New Issue
Block a user