docs: improve route_to() and url_to()#6233
Conversation
MGatner
left a comment
There was a problem hiding this comment.
I know the examples are trying to demonstrate how to use route_to() but I would prefer we remain strict about routes vs. URIs. I can't think of a scenario where route_to() would ever be output to HTML - it is an internal tool.
|
|
||
| <!-- Generate the relative URL to link to user ID 15, gallery 12: --> | ||
| <!-- Generate the URI path (route) to link to user ID 15, gallery 12: --> | ||
| <a href="<?= route_to('Galleries::showUserGallery', 15, 12) ?>">View Gallery</a> |
There was a problem hiding this comment.
We should never use a route I place of a URL, bad practice.
There was a problem hiding this comment.
Replaced route_to() with url_to().
|
|
||
| <!-- Generate the relative URL to link to user ID 15, gallery 12: --> | ||
| <!-- Generate the URI path (route) to link to user ID 15, gallery 12: --> | ||
| <a href="<?= route_to('user_gallery', 15, 12) ?>">View Gallery</a> |
There was a problem hiding this comment.
Replaced route_to() with url_to().
You are correct! |
MGatner
left a comment
There was a problem hiding this comment.
The URL Structure section is a very nice addition.
Description
Fixes #6223
Checklist: