public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if ($options['add_author']) {
            $builder->add('authorName', TextType::class, ['required' => true]);

            $this->vars['add_author'] = $options['add_author'];
        }

        if ($options['show_note']) {
            $builder->add('note', ChoiceType::class, [
                'required' => false,
                'choices' => $this->noteProvider->getValues(),
            ]);
        }

        $builder
            ->add('website', UrlType::class, ['required' => false])
            ->add('email', EmailType::class, ['required' => false])
        ;
    }
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if ($options['add_author']) {
            $builder->add('authorName', TextType::class, ['required' => true]);

            $this->vars['add_author'] = $options['add_author'];
        }

        if ($options['show_note']) {
            $builder->add('note', ChoiceType::class, [
                'required' => false,
                'choices' => $this->noteProvider->getValues(),
            ]);
        }

        $builder
            ->add('website', UrlType::class, ['required' => false])
            ->add('email', EmailType::class, ['required' => false])
        ;
    }
public function buildForm ( FormBuilderInterface $ builder , array $ options ) { if ( $ options [ 'add_author' ] ) { $ builder -> add ( 'authorName' , TextType :: class , [ 'required' => true ] ) ; $ this -> vars [ 'add_author' ] = $ options [ 'add_author' ] ; } if ( $ options [ 'show_note' ] ) { $ builder -> add ( 'note' , ChoiceType :: class , [ 'required' => false , 'choices' => $ this -> noteProvider -> getValues ( ) , ] ) ; } $ builder -> add ( 'website' , UrlType :: class , [ 'required' => false ] ) -> add ( 'email' , EmailType :: class , [ 'required' => false ] ) ; }
Configures a Comment form.

@param FormBuilderInterface $builder
@param array                $options
Configures a Comment form .