Bundle/FormBundle/Form/Type/LinkType.php
protected function addTargetField($form, array $options)
    {
        $rootFormName = $form->getRoot()->getName();

        if ($options['withTarget']) {
            $form->add('target', ChoiceType::class, [
                'label'    => 'form.link_type.target.label',
                'required' => true,
                'choices'  => [
                    'form.link_type.choice.target.parent'     => Link::TARGET_PARENT,
                    'form.link_type.choice.target.blank'      => Link::TARGET_BLANK,
                    'form.link_type.choice.target.ajax-modal' => Link::TARGET_MODAL,
                ],
                'choices_as_values' => true,
                'attr'              => [
                    'data-refreshOnChange' => 'true',
                    'data-target'          => $options['refresh-target'] ?: 'form[name="'.$rootFormName.'"]',
                ],
                'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group viewReference-type page-type url-type route-type attachedWidget-type'],
            ]);
        }
    }
protected function addTargetField($form, array $options)
    {
        $rootFormName = $form->getRoot()->getName();

        if ($options['withTarget']) {
            $form->add('target', ChoiceType::class, [
                'label'    => 'form.link_type.target.label',
                'required' => true,
                'choices'  => [
                    'form.link_type.choice.target.parent'     => Link::TARGET_PARENT,
                    'form.link_type.choice.target.blank'      => Link::TARGET_BLANK,
                    'form.link_type.choice.target.ajax-modal' => Link::TARGET_MODAL,
                ],
                'choices_as_values' => true,
                'attr'              => [
                    'data-refreshOnChange' => 'true',
                    'data-target'          => $options['refresh-target'] ?: 'form[name="'.$rootFormName.'"]',
                ],
                'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group viewReference-type page-type url-type route-type attachedWidget-type'],
            ]);
        }
    }
protected function addTargetField ( $ form , array $ options ) { $ rootFormName = $ form -> getRoot ( ) -> getName ( ) ; if ( $ options [ 'withTarget' ] ) { $ form -> add ( 'target' , ChoiceType :: class , [ 'label' => 'form.link_type.target.label' , 'required' => true , 'choices' => [ 'form.link_type.choice.target.parent' => Link :: TARGET_PARENT , 'form.link_type.choice.target.blank' => Link :: TARGET_BLANK , 'form.link_type.choice.target.ajax-modal' => Link :: TARGET_MODAL , ] , 'choices_as_values' => true , 'attr' => [ 'data-refreshOnChange' => 'true' , 'data-target' => $ options [ 'refresh-target' ] ? : 'form[name="' . $ rootFormName . '"]' , ] , 'vic_vic_widget_form_group_attr' => [ 'class' => 'vic-form-group viewReference-type page-type url-type route-type attachedWidget-type' ] , ] ) ; } }
add the target Field.

@param FormBuilderInterface|FormInterface $form
@param array                              $options
add the target Field .