Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Routing] Allow force-generation of trailing parameters using eg "/exports/news.{!_format}"#29599
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas left a comment
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.
awesome! just a minor comment and good on my side!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas commentedDec 14, 2018
Would you mind creating a doc issue/PR? |
Uh oh!
There was an error while loading.Please reload this page.
| $varName =substr($varName,1); | ||
| $coalescing =true; | ||
| }else { | ||
| $coalescing =false; |
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.
Move beforeif soelse can be removed.
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.
or in one line:if ($important = '!' === $varName[0]) {
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.
@nicolas-grekas nice one. To make it more understandable added( ):$important = ('!' === $varName[0])
luchaninov commentedDec 15, 2018
|
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
OskarStark left a comment
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.
Nice improvement 👍🏻
…xports/news.{!_format}\"nicolas-grekas commentedDec 24, 2018
Thank you@luchaninov. |
…s using eg "/exports/news.{!_format}" (zavulon)This PR was squashed before being merged into the 4.3-dev branch (closes#29599).Discussion----------[Routing] Allow force-generation of trailing parameters using eg "/exports/news.{!_format}"| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#29593| License | MITWhen a route is defined as path: `/exports/news.{!_format}`, we should force `_format` be defined in `defaults` and the generator should generate URLs with that default when none is provided (should work with any parameter of course).Commits-------9fab3d6 [Routing] Allow force-generation of trailing parameters using eg \"/exports/news.{!_format}\"Tobion commentedDec 24, 2018
I think the solution with |
This PR was merged into the master branch.Discussion----------[Router] Marking variable as importantsymfony/symfony#29599Commits-------34f5dfa [Router] Marking variable as important
nicolas-grekas commentedJan 3, 2019
See#29763, help wanted. |
When a route is defined as path:
/exports/news.{!_format}, we should force_formatbe defined indefaultsand the generator should generate URLs with that default when none is provided (should work with any parameter of course).