nieuws/overzicht[/aantal/pagina] toegevoegd
This commit is contained in:
@@ -3,21 +3,29 @@
|
||||
namespace Model;
|
||||
|
||||
class Model {
|
||||
protected function ConvertToDateTime(&$field) {
|
||||
if($field) {
|
||||
$field = new DateTime($field);
|
||||
if($field === false || $field->getTimestamp() == 0) {
|
||||
$field = null;
|
||||
}
|
||||
protected function ConvertToDateTime(&$field) {
|
||||
if($field) {
|
||||
$field = new \DateTime($field);
|
||||
if($field === false || $field->getTimestamp() == 0) {
|
||||
$field = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct($data) {
|
||||
$class = get_class($this);
|
||||
foreach($data as $key => $val) {
|
||||
if(property_exists($class, $key)) {
|
||||
$this->$key = $val;
|
||||
}
|
||||
public function __construct($data) {
|
||||
$class = get_class($this);
|
||||
foreach($data as $key => $val) {
|
||||
if(property_exists($class, $key)) {
|
||||
$this->$key = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function url_slug($text) {
|
||||
$text = strtolower($text);
|
||||
$text = preg_replace('/\b([a-z]{1,3})\b/u', '', $text);
|
||||
$text = preg_replace('/[^\w_\+\s]/', '', $text);
|
||||
$text = preg_replace('/\s+/', '-', $text);
|
||||
return trim(strtolower($text), '-');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user