Bundle/FormBundle/Form/Type/LinkType.php
protected function manageTargetRelatedFields($target, $form, $options)
    {
        if ($target == Link::TARGET_MODAL && count($this->modalLayouts) > 1) {
            $form->add('modalLayout', ChoiceType::class, [
                'label'        => 'form.link_type.target.modalLayouts.label',
                'required'     => true,
                'choices'      => $this->modalLayouts,
                'choice_label' => function ($value, $key, $index) {
                    return 'form.link_type.target.modalLayouts.choices.'.$value;
                },
                'choices_as_values'              => true,
                'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group viewReference-type page-type url-type route-type attachedWidget-type'],
            ]);
        } else {
            $form->remove('modalLayout');
        }
    }
protected function manageTargetRelatedFields($target, $form, $options)
    {
        if ($target == Link::TARGET_MODAL && count($this->modalLayouts) > 1) {
            $form->add('modalLayout', ChoiceType::class, [
                'label'        => 'form.link_type.target.modalLayouts.label',
                'required'     => true,
                'choices'      => $this->modalLayouts,
                'choice_label' => function ($value, $key, $index) {
                    return 'form.link_type.target.modalLayouts.choices.'.$value;
                },
                'choices_as_values'              => true,
                'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group viewReference-type page-type url-type route-type attachedWidget-type'],
            ]);
        } else {
            $form->remove('modalLayout');
        }
    }
protected function manageTargetRelatedFields ( $ target , $ form , $ options ) { if ( $ target == Link :: TARGET_MODAL && count ( $ this -> modalLayouts ) > 1 ) { $ form -> add ( 'modalLayout' , ChoiceType :: class , [ 'label' => 'form.link_type.target.modalLayouts.label' , 'required' => true , 'choices' => $ this -> modalLayouts , 'choice_label' => function ( $ value , $ key , $ index ) { return 'form.link_type.target.modalLayouts.choices.' . $ value ; } , 'choices_as_values' => true , 'vic_vic_widget_form_group_attr' => [ 'class' => 'vic-form-group viewReference-type page-type url-type route-type attachedWidget-type' ] , ] ) ; } else { $ form -> remove ( 'modalLayout' ) ; } }
Add the types related to the target value.

@param string                             $target
@param FormBuilderInterface|FormInterface $form
@param array                              $options
Add the types related to the target value .