@ -30,6 +30,8 @@ class PageRepository extends RepositoryAbstract
// if slug not set, search for empty slug
if (!$slug) {
$slug = [ '_null' => 'true' ];
} else {
$slug = [ '_eq' => $slug ];
}
return $this->queryBuilder
@ -5,6 +5,6 @@ require __DIR__.'/../app/bootstrap.php';
// default routes
$flight->route('GET /404', array(new App\Controllers\PageController, 'notFoundAction'));
$flight->route('GET /(@slug:[a-zA-Z0-9_-])', array(new App\Controllers\PageController, 'getAction'));
$flight->route('GET /(@slug:[a-z0-9\-]+$)', array(new App\Controllers\PageController, 'getAction'));
$flight->start();