Agenda toegevoegd (/agenda/overzicht/{week,maand,alles} en /agenda/details/:id)

This commit is contained in:
2017-06-08 08:40:07 +02:00
parent 9fe4d895b3
commit 5ea381a009
10 changed files with 1138 additions and 38 deletions

View File

@@ -36,14 +36,25 @@ class Model {
}
public function url_slug($text) {
// Alles naar kleine letter
$text = strtolower($text);
// Vervang accent-tekens door niet-geaccentueerde versies
// $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);
// Verwijder alle woorden van 3 letters, behalve BEL (BEL-combinatie etc)
$text = preg_replace('/\b(?!bel)([a-z]{1,3})\b/u', '', $text);
// Vervang alles dat niet een woord-karakter is (letter, cijfer), een streepje of spatie
$text = preg_replace('/[^\w_\-\s]/', '', $text);
// Reeksen van één of meer spaties / streepjes vervangen door een enkel streepje
$text = preg_replace('/[\-\s]+/', '-', $text);
// Verwijder alle witruimte / streepjes aan begin en eind
return trim(strtolower($text), '-');
}
}