Skip to content
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

Added a tip about routes and container parameters #6506

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,13 @@ Path Parameters
``/es`` *won't match this route*
======= ========================

.. tip::

The route requirements can also include container parameters, as explained
in :doc:`this article </cookbook/routing/service_container_parameters>`.
This comes in handy when the regular expression is very complex and used
time and again in your application.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"is very complex and used time and again [...]"? I don't really understand what you're trying to tell with that bit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"time and again" is an idiom for "repeatedly". In the example of the UUID, the problem is that the regexp is horrible. But in other cases the regexp is simple ... but used in 100 different routes ... so it's convenient to turn it into a parameter. Should I reword this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the info. I've learned a new idiom now.


.. index::
single: Routing; Method requirement

Expand Down