nette / routing

Nette Routing: two-ways URL conversion
https://doc.nette.org/routing
Other
231 stars 3 forks source link

RouteList should define domain prefix #12

Open janbarasek opened 2 years ago

janbarasek commented 2 years ago

Very often I need to define a group of routes that have a common prefix in a single RouteList.

For example locale:

$router = new RouteList('Front');
$router->addRoute('https://%host%/<locale>/<presenter>/<action>', ...);

Now there is no easy way to set a common prefix for all routes in a domain (module).

It could be set as a RouteList second argument:

$router = new RouteList('Front', 'https://%host%/<locale>/');
$router->addRoute('<presenter>/<action>', ...);

Thanks.

thorewi commented 2 years ago

Hi,

I guess you can create your own RouteList which extends the default one and handle what you need, or?