-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: improve route_to() and url_to() #6233
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -5,6 +5,6 @@ | |||
|
|||
?> | |||
|
|||
<!-- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never use a route I place of a URL, bad practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced route_to() with url_to().
@@ -5,6 +5,6 @@ | |||
|
|||
?> | |||
|
|||
<!-- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced route_to() with url_to().
You are correct! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URL Structure section is a very nice addition.
Description
Fixes #6223
Checklist: