Created
February 14, 2017 09:29
-
-
Save mikemix/32b7b842e2c0b675180fec12572330a9 to your computer and use it in GitHub Desktop.
Dynamic validation groups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // form skipped for brevity | |
| public function configureOptions(OptionsResolver $resolver) | |
| { | |
| $resolver->setDefaults(array( | |
| 'validation_groups' => function (FormInterface $form) { | |
| return $form->getConfig()->getOption('option_name') ? | |
| ['group1', 'group2'], | |
| ['group3']; | |
| }, | |
| )); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment