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.3] [Form] Support buttons in forms#6528
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.
Changes fromall commits
cc2118d7b438a87b07925277d6df600007b0bc7129ce29c7036ca056c8afa88d504732faf8d7aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| UPGRADE FROM 2.2 to 2.3 | ||
| ======================= | ||
| ### Form | ||
| * Although this was not officially supported nor documented, it was possible to | ||
| set the option "validation_groups" to false, resulting in the group "Default" | ||
| being validated. Now, if you set "validation_groups" to false, the validation | ||
| of a form will be skipped (except for a few integrity checks on the form). | ||
| If you want to validate a form in group "Default", you should either | ||
| explicitly set "validation_groups" to "Default" or alternatively set it to | ||
| null. | ||
| Before: | ||
| ``` | ||
| // equivalent notations for validating in group "Default" | ||
| "validation_groups" => null | ||
| "validation_groups" => "Default" | ||
| "validation_groups" => false | ||
| // notation for skipping validation | ||
| "validation_groups" => array() | ||
| ``` | ||
| After: | ||
| ``` | ||
| // equivalent notations for validating in group "Default" | ||
| "validation_groups" => null | ||
| "validation_groups" => "Default" | ||
| // equivalent notations for skipping validation | ||
| "validation_groups" => false | ||
| "validation_groups" => array() | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -140,6 +140,15 @@ | ||
| <service id="form.type.url" class="Symfony\Component\Form\Extension\Core\Type\UrlType"> | ||
| <tag name="form.type" alias="url" /> | ||
| </service> | ||
| <service id="form.type.button" class="Symfony\Component\Form\Extension\Core\Type\ButtonType"> | ||
| <tag name="form.type" alias="button" /> | ||
| </service> | ||
| <service id="form.type.submit" class="Symfony\Component\Form\Extension\Core\Type\SubmitType"> | ||
| <tag name="form.type" alias="submit" /> | ||
| </service> | ||
| <service id="form.type.reset" class="Symfony\Component\Form\Extension\Core\Type\ResetType"> | ||
| <tag name="form.type" alias="reset" /> | ||
| </service> | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. you also need to register the Validator SubmitButtonTypeExtension ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Fixed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. can I use if $form->get('clickme') == null to check if this exist or not ? if ($form->get('clickme') != null && $form->get('clickme')->isClicked()) { Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @josephzhao | ||
| <!-- FormTypeHttpFoundationExtension --> | ||
| <service id="form.type_extension.form.http_foundation" class="Symfony\Component\Form\Extension\HttpFoundation\Type\FormTypeHttpFoundationExtension"> | ||
| @@ -154,5 +163,8 @@ | ||
| <service id="form.type_extension.repeated.validator" class="Symfony\Component\Form\Extension\Validator\Type\RepeatedTypeValidatorExtension"> | ||
| <tag name="form.type_extension" alias="repeated" /> | ||
| </service> | ||
| <service id="form.type_extension.submit.validator" class="Symfony\Component\Form\Extension\Validator\Type\SubmitTypeValidatorExtension"> | ||
| <tag name="form.type_extension" alias="submit" /> | ||
| </service> | ||
| </services> | ||
| </container> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| id="<?php echo $view->escape($id) ?>" | ||
| name="<?php echo $view->escape($full_name) ?>" | ||
| <?php if ($disabled): ?>disabled="disabled" <?php endif ?> | ||
| <?php foreach ($attr as $k => $v): ?> | ||
| <?php printf('%s="%s" ', $view->escape($k), $view->escape($v)) ?> | ||
| <?php endforeach; ?> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| <div> | ||
| <?php echo $view['form']->widget($form) ?> | ||
| </div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?php if (!$label) { $label = $view['form']->humanize($name); } ?> | ||
| <button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>> | ||
| <?php $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?> | ||
| </button> |
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <tr> | ||
| <td></td> | ||
| <td> | ||
| <?php echo $view['form']->widget($form) ?> | ||
| </td> | ||
| </tr> |
Uh oh!
There was an error while loading.Please reload this page.