Guest User

Untitled

a guest
Jun 3rd, 2015
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class RouterFactory {
  2.  
  3.     /**
  4.      * @return \Nette\Application\IRouter
  5.      */
  6.     public static function createRouter($defaultLanguage, \Services\UrlFilter $urlFilter) {
  7.         $router = new RouteList();
  8.         $router[] = new Route('index.php', 'Frontend:Product:default', Route::ONE_WAY);
  9.         $router[] = new Route('[<lang [a-z]{2}>/]<presenter>/<action>/<id>[-<title>]', [
  10.                     'lang' =>  $defaultLanguage,
  11.                     'module' => 'Frontend',
  12.                     'presenter' => [
  13.                         Route::VALUE => 'Product',
  14.                         Route::FILTER_IN => array($urlFilter, 'presenterFilterIn'),
  15.                         Route::FILTER_OUT => array($urlFilter, 'presenterFilterOut'),
  16.                     ],
  17.                     'action' => [
  18.                         Route::VALUE => 'list',
  19.                         Route::FILTER_IN => array($urlFilter, 'actionFilterIn'),
  20.                         Route::FILTER_OUT => array($urlFilter, 'actionFilterOut'),
  21.                     ],
  22.                     'id' => null,
  23.                     'title' => null
  24.                 ]);
  25.  
  26.         return $router;
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment