minor #14825 Documenting how to keep option value BC - see #14377 (weaverryan)

This PR was merged into the 2.7 branch.

Discussion
----------

Documenting how to keep option value BC - see #14377

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14377 (kinda)
| License       | MIT
| Doc PR        | symfony/symfony-docs#5179

Hi guys!

I'm still making sense of the form changes, but it seems that this before and after isn't totally honest - your option values will change, unless your add this extra option.

@webmozart look correct to you?

Thanks!

Commits
-------

deb9db8 Documenting how to keep option value BC - see #14377
This commit is contained in:
Fabien Potencier 2015-06-10 18:35:05 +02:00
commit b3b1c459b3
1 changed files with 5 additions and 0 deletions

View File

@ -134,6 +134,11 @@ Form
'Ignored' => Status::IGNORED,
),
'choices_as_values' => true,
// important if you rely on your option value attribute (e.g. for JavaScript)
// this will keep the same functionality as before
'choice_value' => function ($choice) {
return $choice;
},
));
```