SHOW:
|
|
- or go back to the newest paste.
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>]', array( |
9 | + | $router[] = new Route('[<lang [a-z]{2}>/]<presenter>/<action>/<id>[-<title>]', [ |
10 | 'lang' => $defaultLanguage, | |
11 | 'module' => 'Frontend', | |
12 | - | 'presenter' => array( |
12 | + | 'presenter' => [ |
13 | Route::VALUE => 'Product', | |
14 | Route::FILTER_IN => array($urlFilter, 'presenterFilterIn'), | |
15 | Route::FILTER_OUT => array($urlFilter, 'presenterFilterOut'), | |
16 | - | ), |
16 | + | ], |
17 | - | 'action' => array( |
17 | + | 'action' => [ |
18 | Route::VALUE => 'list', | |
19 | Route::FILTER_IN => array($urlFilter, 'actionFilterIn'), | |
20 | Route::FILTER_OUT => array($urlFilter, 'actionFilterOut'), | |
21 | - | ), |
21 | + | ], |
22 | 'id' => null, | |
23 | 'title' => null | |
24 | - | )); |
24 | + | ]); |
25 | ||
26 | return $router; | |
27 | } | |
28 | ||
29 | } |