use Symfony\Component\Validator\Constraints as Assert; class StudyType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('customer_agreement', 'textarea', array( 'required' => true, 'label' => 'ձһن', 'constraints' => array( new Assert\NotBlank()), )); } /** * {@inheritdoc} */ public function getName() { return 'study'; } }