-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2327 from jim-parry/fix/route-docs
Correct the routing UG page
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,10 +122,10 @@ is allowed, as are back-references. | |
.. important:: Note: If you use back-references you must use the dollar syntax rather than the double backslash syntax. | ||
A typical RegEx route might look something like this:: | ||
|
||
$routes->add('products/([a-z]+)/(\d+)', '$1::id_$2'); | ||
$routes->add('products/([a-z]+)/(\d+)', 'Products::show/$1/id_$2'); | ||
|
||
In the above example, a URI similar to products/shirts/123 would instead call the “\Shirts” controller class | ||
and the “id_123” method. | ||
In the above example, a URI similar to products/shirts/123 would instead call the ``show`` method | ||
of the ``Products`` controller class, with the original first and second segment passwed as arguments to it. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jim-parry
Contributor
|
||
|
||
With regular expressions, you can also catch a segment containing a forward slash (‘/’), which would usually | ||
represent the delimiter between multiple segments. | ||
|
1 comment
on commit cc34771
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.
Aha - I see that now. My bad!
of the
Products
controller class, with the original first and second segment passed as arguments to it.