Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[2.2][Routing] Added support for default attributes with default values of method params#5904
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
Tobion commentedNov 3, 2012
I'm unsure. How does one know if that param defines a default value or a requirement? It's too vague. |
lyrixx commentedNov 3, 2012
It's only a default value, not a requirement. |
Tobion commentedNov 3, 2012
Yes, but its not clear. It could also be a shortcut to |
lyrixx commentedNov 3, 2012
it is the default php behavior. It's a default value for a variable... |
stof commentedNov 4, 2012
@Tobion using the default value of the method to set a requirement does not make any sense. I don't see why someone would expect this behavior |
fabpot commentedNov 6, 2012
@lyrixx Can you add some unit tests? |
Tobion commentedNov 6, 2012
Oh I misunderstood the PR. I thought this makes the |
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.
getDefaultValue()
fabpot commentedNov 10, 2012
@lyrixx Can you finish this PR? |
lyrixx commentedNov 10, 2012
@fabpot Yes i will as soon as possible. |
lyrixx commentedNov 10, 2012
I rebase and amend my commit. (I changed doc in commit message to be less confusing) I will try to add tests. |
… method paramsYou can configure default values likes this:``` php/** *@route("/hi/{username}", name="hi") */public function hiAction($username = "Bob"){ return new Response($username);}```
lyrixx commentedNov 11, 2012
@fabpot I added new tests. I tried to made very atomic commits. |
This PR was merged into the master branch.Commits-------79d7839 [Doc] Added more doc about default value06e22ab [Doc] Be more consistant on routing exampleDiscussion----------Doc command default valueseesymfony/symfony#5904
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
With this patch, you can configure your default values likes this: