Exemplo n.º 1
0
 protected function getRoute()
 {
     $route = new RecursiveRoute('/');
     $subRoute1 = new RecursiveRoute(':module/:title');
     $subRoute2 = new RecursiveRoute(':module/:id');
     $subRoute2->setValidators(array('id' => '/^\\d+$/'));
     $route->addRoute($subRoute1);
     $route->addRoute($subRoute2);
     return $route;
 }
Exemplo n.º 2
0
 protected function getThreeLevelRoute()
 {
     $route = new RecursiveRoute('/');
     $newsRoute = new RecursiveRoute('/news/');
     $newsRoute->addRoute(':id/:title/');
     $newsRoute->addRoute('archive/:year/:month');
     $route->addRoute($newsRoute);
     $pagesRoute = new RecursiveRoute('page');
     $pagesRoute->addRoute(':page_id');
     $pagesRoute->addRoute(':page_id/:page_title');
     $route->addRoute($pagesRoute);
     return $route;
 }