Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RouterFactory {
- /**
- * @return \Nette\Application\IRouter
- */
- public static function createRouter($defaultLanguage, \Services\UrlFilter $urlFilter) {
- $router = new RouteList();
- $router[] = new Route('index.php', 'Frontend:Product:default', Route::ONE_WAY);
- $router[] = new Route('[<lang [a-z]{2}>/]<presenter>/<action>/<id>[-<title>]', [
- 'lang' => $defaultLanguage,
- 'module' => 'Frontend',
- 'presenter' => [
- Route::VALUE => 'Product',
- Route::FILTER_IN => array($urlFilter, 'presenterFilterIn'),
- Route::FILTER_OUT => array($urlFilter, 'presenterFilterOut'),
- ],
- 'action' => [
- Route::VALUE => 'list',
- Route::FILTER_IN => array($urlFilter, 'actionFilterIn'),
- Route::FILTER_OUT => array($urlFilter, 'actionFilterOut'),
- ],
- 'id' => null,
- 'title' => null
- ]);
- return $router;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment