Skip to content

Fixed the params in ChoiceType methods #9835

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
javiereguiluz committed May 28, 2018
commit 45873602c606150639d3637a89c917f8b9dd378c
2 changes: 1 addition & 1 deletion reference/forms/types/options/choice_attr.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If an array, the keys of the ``choices`` array must be used as keys::
'Maybe' => null,
),
'choices_as_values' => true,
'choice_attr' => function($category, $key, $value) {
'choice_attr' => function($choiceValue, $key, $value) {
// adds a class like attending_yes, attending_no, etc
return ['class' => 'attending_'.strtolower($key)];
},
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/options/choice_label.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ more control::
'maybe' => null,
),
'choices_as_values' => true,
'choice_label' => function ($category, $key, $value) {
'choice_label' => function ($choiceValue, $key, $value) {
if ($value == true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that is makes more sense to check true === $choiceValue here.

return 'Definitely!';
}
Expand Down
4 changes: 2 additions & 2 deletions reference/forms/types/options/group_by.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Take the following example::
'1 month' => new \DateTime('+1 month'),
),
'choices_as_values' => true,
'group_by' => function($vategory, $key, $value) {
if ($value <= new \DateTime('+3 days')) {
'group_by' => function($choiceValue, $key, $value) {
if ($choiceValue <= new \DateTime('+3 days')) {
return 'Soon';
} else {
return 'Later';
Expand Down