Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Commit5a158ea
committed
merged branch bschussek/issue5383 (PR#6528)
This PR was merged into the master branch.Discussion----------[2.3] [Form] Support buttons in formsBug fix: noFeature addition: yesBackwards compatibility break: yesSymfony2 tests pass: yesFixes the following tickets:#5383Todo: -License of the code: MITDocumentation PR:symfony/symfony-docs#2489The general idea of this PR is to be able to add buttons to forms like so:```php$builder->add('clickme', 'submit');```You can then check in the controller whether the button was clicked:```phpif ($form->get('clickme')->isClicked()) { // do stuff}```Button-specific validation groups are also supported:```php$builder->add('clickme', 'submit', array( 'validation_groups' => 'OnlyClickMe',));```The validation group will then override the one defined in the form if that button is clicked.This PR also introduces the disabling of form validation by passing the value `false` in the option `validation_groups`:```php$builder->add('clickme', 'submit', array( 'validation_groups' => false,));```The same can be achieved (already before this PR) by passing an empty array:```php$builder->add('clickme', 'submit', array( 'validation_groups' => array(),));```See the linked documentation for more information.Commits-------faf8d7a [Form] Added upgrade information about setting "validation_groups" => falsed504732 [Form] Added leading backslashes to @exceptionMessage doc blocksc8afa88 [Form] Removed deprecated code scheduled for removal in 2.336ca056 [Form] Simplified Twig codece29c70 [Form] Fixed incorrect doc comment0bc7129 [Form] Fixed invalid use of FormException600007b [Form] The option "validation_groups" can now be set to false to disable validation. This is identical to setting it to an empty array.277d6df [Form] Fixed concatenation operator CS (see7c47e34)7b07925 [Form] Changed isset() to array_key_exists() to be consistent with ParameterBag7b438a8 [Form] Made submit buttons able to convey validation groupscc2118d [Form] Implemented support for buttonsFile tree
62 files changed
+2404
-395
lines changed- src/Symfony
- Bridge/Twig/Resources/views/Form
- Bundle/FrameworkBundle/Resources
- config
- views
- FormTable
- Form
- Component
- Config/Tests/Definition
- Form
- Exception
- Extension
- Core
- Type
- Validator
- Constraints
- Type
- Tests
- Extension
- Core/Type
- Validator
- Constraints
- Type
- ViolationMapper
- Translation/Tests/Loader
- Validator/Tests/Mapping/Loader
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
62 files changed
+2404
-395
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
Lines changed: 39 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
221 | 244 | | |
222 | 245 | | |
223 | 246 | | |
| |||
237 | 260 | | |
238 | 261 | | |
239 | 262 | | |
| 263 | + | |
| 264 | + | |
240 | 265 | | |
241 | 266 | | |
242 | 267 | | |
| |||
259 | 284 | | |
260 | 285 | | |
261 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
262 | 295 | | |
263 | 296 | | |
264 | 297 | | |
| |||
317 | 350 | | |
318 | 351 | | |
319 | 352 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
17 | 28 | | |
18 | 29 | | |
19 | 30 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
| |||
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
157 | 169 | | |
158 | 170 | | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 0 additions & 1 deletion
This file was deleted.
0 commit comments
Comments
(0)