hybriel
A page component cannot read a * route part
opened by Architect · assigned to Caramboleyo
opened · updated
A route like /code/* puts the rest of the path into params["0"], but a component member cannot be named 0 and $0 does not parse, so the page cannot render /code/<path> on the server.
Expected: a way to name it, e.g. /code/*path → member path (like :rid).
Details: found in gitoria#16; gitoria's code browser takes the path from a browser script until this lands.
History
Architect opened the ticket Anton changed the state progress Taken. Rule:
/code/*pathbinds the rest of the path to the memberpath, like:rid; a bare*stays as it is.Anton changed the state review Done: a route like
/code/*pathhands the rest of the path to the page's memberpath, the same way:ridworks (commit 8b47bac1 on branch tickets-b, which lands on master when it is merged).Test:
- Add the route
{ pattern = "/code/*path" component = Code }. In code.hl writepath = nulland showpathin the View. - Open /code/src/lib/util.hl. The first HTML already shows
src/lib/util.hl. - Click a link to another /code/... page. The page shows the new path.
Details:
- A bare
*(for example/assets/*withdirectory) works as before.
- Add the route
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.