Zoekfunctie, links gefixt
This commit is contained in:
@@ -61,6 +61,7 @@ class FormatterHelper
|
||||
|
||||
public static function excerpt($text, $maxLength)
|
||||
{
|
||||
$allowed = '<mark>';
|
||||
if(strlen($text) < $maxLength)
|
||||
{
|
||||
return $text;
|
||||
@@ -69,10 +70,10 @@ class FormatterHelper
|
||||
$matches = [];
|
||||
if(preg_match('/\W/', $text, $matches, PREG_OFFSET_CAPTURE, $maxLength))
|
||||
{
|
||||
return substr(strip_tags($text), 0, $matches[0][1]) . "...";
|
||||
return substr(strip_tags($text, $allowed), 0, $matches[0][1]) . "...";
|
||||
}
|
||||
|
||||
return substr(strip_tags($text), $maxLength) . "...";
|
||||
return substr(strip_tags($text, $allowed), $maxLength) . "...";
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -93,4 +93,11 @@ class Controller extends BaseController
|
||||
return new \DateTime($obj->date, new \DateTimeZone($obj->timezone));
|
||||
}
|
||||
|
||||
public function __call($method, $arguments) {
|
||||
if(substr($method, 0, 5) == 'view_') {
|
||||
$view = substr($method, 5);
|
||||
if(view()->exists($view)) { return view($view); }
|
||||
}
|
||||
return abort(404);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ class NewsController extends Controller
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
return view($request->ajax() ? 'partial/newslist_small' : 'newslist', ['title' => $title, 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
|
||||
return view($request->ajax() ? 'partial/newslist_small' : ($title == null ? 'home' : 'newslist'), ['title' => $title, 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
|
||||
}
|
||||
|
||||
public function popular()
|
||||
|
||||
Reference in New Issue
Block a user