-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[Form] Merge some small articles into the main form article #21740
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
Conversation
| To achieve this, use the ``expression`` option of the | ||
| :doc:`When constraint </reference/constraints/When>` to reference the other field:: | ||
|
|
||
| use Symfony\Component\Validator\Constraints as Assert; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why the validator fails in this ... this import works and it's the same in all the other examples in the docs.
890c62c to
d8cda71
Compare
|
I'm going to merge this PR because it's only about moving contents around, not adding/changing contents. But, for the next form PRs, I'll need reviews from Symfony Form experts 🙏 Thanks! |
| ->add('lastName', TextType::class) | ||
| ->getForm(); | ||
|
|
||
| Conditional Constraints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another way to do that is to configure the validation_groups option of the form with a callable. This is currently documented in https://symfony.com/doc/current/form/validation_groups.html but it might deserve a link from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review! I'm adding this in #21791. Thanks.
…on groups (javiereguiluz) This PR was merged into the 6.4 branch. Discussion ---------- [Form] Mention conditional constraints via form validation groups As mentioned in #21740 (review) Commits ------- 9fb0224 [Form] Mention conditional constraitns via form validation groups
I'm going to revamp the docs about Symfony Forms. I'll do that in several small PRs. This is the first one, which does a basic cleanup by merging tiny separate articles into the main forms article.