public static function createFormView(BlockView $view, BlockInterface $block)
    {
        $parentForm = static::getParentFormView($view);

        if (null !== $parentForm) {
            $formPath = $block->hasOption('form_path') && null !== $block->getOption('form_path')
                ? $block->getOption('form_path')
                : $block->getName();
            $formNames = explode('.', $formPath);
            $form = $parentForm->vars['form'];

            foreach ($formNames as $formName) {
                if (isset($form->children[$formName])) {
                    $form = $form->children[$formName];
                }
            }

            if ($form !== $parentForm->vars['form']) {
                return $form;
            }
        }

        return $block->getForm()->createView($parentForm);
    }
public static function createFormView(BlockView $view, BlockInterface $block)
    {
        $parentForm = static::getParentFormView($view);

        if (null !== $parentForm) {
            $formPath = $block->hasOption('form_path') && null !== $block->getOption('form_path')
                ? $block->getOption('form_path')
                : $block->getName();
            $formNames = explode('.', $formPath);
            $form = $parentForm->vars['form'];

            foreach ($formNames as $formName) {
                if (isset($form->children[$formName])) {
                    $form = $form->children[$formName];
                }
            }

            if ($form !== $parentForm->vars['form']) {
                return $form;
            }
        }

        return $block->getForm()->createView($parentForm);
    }
public static function createFormView ( BlockView $ view , BlockInterface $ block ) { $ parentForm = static :: getParentFormView ( $ view ) ; if ( null !== $ parentForm ) { $ formPath = $ block -> hasOption ( 'form_path' ) && null !== $ block -> getOption ( 'form_path' ) ? $ block -> getOption ( 'form_path' ) : $ block -> getName ( ) ; $ formNames = explode ( '.' , $ formPath ) ; $ form = $ parentForm -> vars [ 'form' ] ; foreach ( $ formNames as $ formName ) { if ( isset ( $ form -> children [ $ formName ] ) ) { $ form = $ form -> children [ $ formName ] ; } } if ( $ form !== $ parentForm -> vars [ 'form' ] ) { return $ form ; } } return $ block -> getForm ( ) -> createView ( $ parentForm ) ; }
Create form view.

@param BlockView      $view
@param BlockInterface $block

@return FormView
Create form view .