Bundle/FormBundle/Form/Type/LinkType.php
protected function manageRefreshTarget($form, $options)
    {
        $rootFormName = $form->getRoot()->getName();
        $linkTypeConfig = $form->get('linkType')->getConfig();
        $linkTypeOptions = $linkTypeConfig->getOptions();

        $form->add(
            'linkType',
            get_class($linkTypeConfig->getType()->getInnerType()),
            array_replace(
                $linkTypeOptions,
                [
                    'attr' => [
                        'data-refreshOnChange' => 'true',
                        'data-target'          => $options['refresh-target'] ?: 'form[name="'.$rootFormName.'"]',
                    ],
                ]
            )
        );
    }
protected function manageRefreshTarget($form, $options)
    {
        $rootFormName = $form->getRoot()->getName();
        $linkTypeConfig = $form->get('linkType')->getConfig();
        $linkTypeOptions = $linkTypeConfig->getOptions();

        $form->add(
            'linkType',
            get_class($linkTypeConfig->getType()->getInnerType()),
            array_replace(
                $linkTypeOptions,
                [
                    'attr' => [
                        'data-refreshOnChange' => 'true',
                        'data-target'          => $options['refresh-target'] ?: 'form[name="'.$rootFormName.'"]',
                    ],
                ]
            )
        );
    }
protected function manageRefreshTarget ( $ form , $ options ) { $ rootFormName = $ form -> getRoot ( ) -> getName ( ) ; $ linkTypeConfig = $ form -> get ( 'linkType' ) -> getConfig ( ) ; $ linkTypeOptions = $ linkTypeConfig -> getOptions ( ) ; $ form -> add ( 'linkType' , get_class ( $ linkTypeConfig -> getType ( ) -> getInnerType ( ) ) , array_replace ( $ linkTypeOptions , [ 'attr' => [ 'data-refreshOnChange' => 'true' , 'data-target' => $ options [ 'refresh-target' ] ? : 'form[name="' . $ rootFormName . '"]' , ] , ] ) ) ; }
By default set data-target to root Form.

@param FormInterface $form
@param array         $options
By default set data - target to root Form .