Routing for Presenters with More than One Word in Name

Notice: This thread is very old.
dqj
Member | 11
+
0
-

The presenter Instrument works fine with my routing, but I cannot get anything to work with InstrumentSchedule, unless I write a specific route that hard-codes ‘instrumentSchedule’ in it. I have tried adding a filter table, but that does not work either:

`$router[] = new Route(‘<presenter>[/<id>][/m/<mode>]’,
[
‘presenter’ ⇒ [
Route::VALUE ⇒ ‘Homepage’,
Route::FILTER_TABLE ⇒ [‘instrumentSchedule’ ⇒ ‘InstrumentSchedule’],
],
‘action’ ⇒ ‘read’,
‘id’ ⇒ NULL
 ]);`

Other people must run in to this issue all the time, right?

David Matějka
Moderator | 6445
+
0
-

There are filters for converting presenter name between the URL and the application – https://api.nette.org/…ute.php.html#…
Your InstrumentSchedule is represented as instrument-schedule in the url.

You can change default filters using FILTER_OUT and FILTER_IN.

dqj
Member | 11
+
0
-

Ah, thank you! I missed that in the documentation.