public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $view->vars['translation'] = isset($options['translation']) && $options['translation'] === true;
        $view->vars['currentLocale'] = $this->defaultLocale;
        if($view->vars['translation']) {
            $parent = $form->getParent();
            if($parent instanceof Form) {
                $property = new Property($form->getPropertyPath());
                $entity = $parent->getConfig()->getDataClass();
                if(is_object($parent->getData())) {
                    $entity = $parent->getData();
                }

                $translations = $this->translator->getTranslationData($entity, $property);
                if($translations === null) {
                    $view->vars['translation'] = false;
                    return;
                }
                $view->vars['translations'] = $translations;
            }
        }
    }
public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $view->vars['translation'] = isset($options['translation']) && $options['translation'] === true;
        $view->vars['currentLocale'] = $this->defaultLocale;
        if($view->vars['translation']) {
            $parent = $form->getParent();
            if($parent instanceof Form) {
                $property = new Property($form->getPropertyPath());
                $entity = $parent->getConfig()->getDataClass();
                if(is_object($parent->getData())) {
                    $entity = $parent->getData();
                }

                $translations = $this->translator->getTranslationData($entity, $property);
                if($translations === null) {
                    $view->vars['translation'] = false;
                    return;
                }
                $view->vars['translations'] = $translations;
            }
        }
    }
public function buildView ( FormView $ view , FormInterface $ form , array $ options ) { $ view -> vars [ 'translation' ] = isset ( $ options [ 'translation' ] ) && $ options [ 'translation' ] === true ; $ view -> vars [ 'currentLocale' ] = $ this -> defaultLocale ; if ( $ view -> vars [ 'translation' ] ) { $ parent = $ form -> getParent ( ) ; if ( $ parent instanceof Form ) { $ property = new Property ( $ form -> getPropertyPath ( ) ) ; $ entity = $ parent -> getConfig ( ) -> getDataClass ( ) ; if ( is_object ( $ parent -> getData ( ) ) ) { $ entity = $ parent -> getData ( ) ; } $ translations = $ this -> translator -> getTranslationData ( $ entity , $ property ) ; if ( $ translations === null ) { $ view -> vars [ 'translation' ] = false ; return ; } $ view -> vars [ 'translations' ] = $ translations ; } } }
Pass the image URL to the view

@param FormView $view
@param FormInterface $form
@param array $options
Pass the image URL to the view