public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $data = $form->getParent()->getData();
        if ($options['currentFile'] || $data instanceof AbstractUploadable) {
            try {
                $currentFile = isset($options['currentFile']) && $options['currentFile'] ? $options['currentFile'] : $data->getWebPath($form->getName());
            } catch (\Exception $e) {
                // In some cases, getWebPath might throw an exception
                $currentFile = null;
            }

            if ($currentFile) {
                $view->vars['currentFile'] = $currentFile;
                $view->vars['currentFileUrl'] = isset($options['currentFileUrl']) && $options['currentFileUrl'] ? $options['currentFileUrl'] : false;
                $view->vars['showDelete'] = $options['showDelete'] && is_string($options['showDelete']) ? $options['showDelete'] : false;
            }
        }
    }
public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $data = $form->getParent()->getData();
        if ($options['currentFile'] || $data instanceof AbstractUploadable) {
            try {
                $currentFile = isset($options['currentFile']) && $options['currentFile'] ? $options['currentFile'] : $data->getWebPath($form->getName());
            } catch (\Exception $e) {
                // In some cases, getWebPath might throw an exception
                $currentFile = null;
            }

            if ($currentFile) {
                $view->vars['currentFile'] = $currentFile;
                $view->vars['currentFileUrl'] = isset($options['currentFileUrl']) && $options['currentFileUrl'] ? $options['currentFileUrl'] : false;
                $view->vars['showDelete'] = $options['showDelete'] && is_string($options['showDelete']) ? $options['showDelete'] : false;
            }
        }
    }
public function buildView ( FormView $ view , FormInterface $ form , array $ options ) { $ data = $ form -> getParent ( ) -> getData ( ) ; if ( $ options [ 'currentFile' ] || $ data instanceof AbstractUploadable ) { try { $ currentFile = isset ( $ options [ 'currentFile' ] ) && $ options [ 'currentFile' ] ? $ options [ 'currentFile' ] : $ data -> getWebPath ( $ form -> getName ( ) ) ; } catch ( \ Exception $ e ) { // In some cases, getWebPath might throw an exception $ currentFile = null ; } if ( $ currentFile ) { $ view -> vars [ 'currentFile' ] = $ currentFile ; $ view -> vars [ 'currentFileUrl' ] = isset ( $ options [ 'currentFileUrl' ] ) && $ options [ 'currentFileUrl' ] ? $ options [ 'currentFileUrl' ] : false ; $ view -> vars [ 'showDelete' ] = $ options [ 'showDelete' ] && is_string ( $ options [ 'showDelete' ] ) ? $ options [ 'showDelete' ] : false ; } } }
Pass the image URL to the view.

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