If you enable automatically generated internal IDs or set your own internal IDs,
then many paths can point to exactly one presenter.
(How to enable auto internal IDs can be found in Router Settings section at the bottom of this page)

You can write your urls this way if auto internal IDs are enabled. You don't have
to specify internal IDs for routes pointing to same presenter.

So, let's say we have auto generated internal IDs enabled or we have many paths pointing
to one presenter and each path has manually set internal ID.
We can then create templates, name them after identifiers and process them:

classPagePresenterextendsNette\Application\UI\Presenter{// $internalId parameter is the identifierpublicfunctionactionDefault($internalId) {$this->setView($internalId);// or load page from database if you write your own url loader }}

If you don't like automatically created identifiers, you can set your
own:

Redirection

If you have an old Url (and that Url does not have set Presenter and Action) that
you want to redirect to a new one but you don't want
to create links on this old one url, you can set it as one way url:

Locale have to be specified at the start of the URL path so Router can
take this locale and create a parameter that will be passed into application.
Only locales that are set in list can be turned into parameter.

Parameter filters

You can add to router a parameter filter that will modify a value of a parameter in
url's query string.

Example: If you want to hide real, integer IDs in url.

We have to create a parameter filter first, so let's create a class that
implements interface IParameterFilter.

classPageIdFilterimplementsIParameterFilter{// Method returns name of the filter// (must be unique otherwise an exception will be thrown)publicfunctiongetName(): string {return'PageIdFilter'; }// method that have to "decode" encoded parameterpublicfunctionfilterIn($modifiedParameter): ?string {return (string)hexdec($modifiedParameter); }// method that have to "encode" parameterpublicfunctionfilterOut($parameter): ?string {return (string)dechex($parameter); }}

So, we've created our parameter filter and we have to register it in our
config file as a service.
Router extension will find this service and automatically adds it into the Router.

config.neon

services:
- PageIdFilter

Parameter filter is now ready to use. Each path in routing file can have "filters"
section where we can specify which parameters should be affected by our filters.