diff --git a/form/without_class.rst b/form/without_class.rst index c0da3c9db5a..9006b9df2c1 100644 --- a/form/without_class.rst +++ b/form/without_class.rst @@ -186,6 +186,8 @@ fields (e.g. a field must not be blank when another field has a certain value). To achieve this, use the ``expression`` option of the :doc:`When constraint ` to reference the other field:: + use Symfony\Component\Validator\Constraints as Assert; + $builder ->add('how_did_you_hear', ChoiceType::class, [ 'required' => true,