Browse Source

adding #1

develop
HerrHase 3 years ago
parent
commit
22cb18d47a
2 changed files with 3 additions and 1 deletions
  1. +2
    -0
      app/Repositories/PageRepository.php
  2. +1
    -1
      public/index.php

+ 2
- 0
app/Repositories/PageRepository.php View File

@ -30,6 +30,8 @@ class PageRepository extends RepositoryAbstract
// if slug not set, search for empty slug // if slug not set, search for empty slug
if (!$slug) { if (!$slug) {
$slug = [ '_null' => 'true' ]; $slug = [ '_null' => 'true' ];
} else {
$slug = [ '_eq' => $slug ];
} }
return $this->queryBuilder return $this->queryBuilder


+ 1
- 1
public/index.php View File

@ -5,6 +5,6 @@ require __DIR__.'/../app/bootstrap.php';
// default routes // default routes
$flight->route('GET /404', array(new App\Controllers\PageController, 'notFoundAction')); $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(); $flight->start();

Loading…
Cancel
Save