lib/Block/Form/EditType.php
protected function addViewTypeForm(FormBuilderInterface $builder, array $options): void
    {
        /** @var \Netgen\BlockManager\Block\BlockDefinitionInterface $blockDefinition */
        $blockDefinition = $options['block']->getDefinition();

        $this->processViewTypeConfig($blockDefinition);

        $builder->add(
            'view_type',
            ChoiceType::class,
            [
                'label' => 'block.view_type',
                'choices' => array_flip($this->viewTypes),
                'property_path' => 'viewType',
            ] + $this->getChoicesAsValuesOption()
        );

        $builder->add(
            'item_view_type',
            ChoiceType::class,
            [
                'label' => 'block.item_view_type',
                'choices' => array_flip(call_user_func_array('array_merge', $this->itemViewTypes)),
                'choice_attr' => function ($value): array {
                    return [
                        'data-master' => implode(',', $this->viewTypesByItemViewType[$value]),
                    ];
                },
                'property_path' => 'itemViewType',
            ] + $this->getChoicesAsValuesOption()
        );
    }
protected function addViewTypeForm(FormBuilderInterface $builder, array $options): void
    {
        /** @var \Netgen\BlockManager\Block\BlockDefinitionInterface $blockDefinition */
        $blockDefinition = $options['block']->getDefinition();

        $this->processViewTypeConfig($blockDefinition);

        $builder->add(
            'view_type',
            ChoiceType::class,
            [
                'label' => 'block.view_type',
                'choices' => array_flip($this->viewTypes),
                'property_path' => 'viewType',
            ] + $this->getChoicesAsValuesOption()
        );

        $builder->add(
            'item_view_type',
            ChoiceType::class,
            [
                'label' => 'block.item_view_type',
                'choices' => array_flip(call_user_func_array('array_merge', $this->itemViewTypes)),
                'choice_attr' => function ($value): array {
                    return [
                        'data-master' => implode(',', $this->viewTypesByItemViewType[$value]),
                    ];
                },
                'property_path' => 'itemViewType',
            ] + $this->getChoicesAsValuesOption()
        );
    }
protected function addViewTypeForm ( FormBuilderInterface $ builder , array $ options ) : void { /** @var \Netgen\BlockManager\Block\BlockDefinitionInterface $blockDefinition */ $ blockDefinition = $ options [ 'block' ] -> getDefinition ( ) ; $ this -> processViewTypeConfig ( $ blockDefinition ) ; $ builder -> add ( 'view_type' , ChoiceType :: class , [ 'label' => 'block.view_type' , 'choices' => array_flip ( $ this -> viewTypes ) , 'property_path' => 'viewType' , ] + $ this -> getChoicesAsValuesOption ( ) ) ; $ builder -> add ( 'item_view_type' , ChoiceType :: class , [ 'label' => 'block.item_view_type' , 'choices' => array_flip ( call_user_func_array ( 'array_merge' , $ this -> itemViewTypes ) ) , 'choice_attr' => function ( $ value ) : array { return [ 'data-master' => implode ( ',' , $ this -> viewTypesByItemViewType [ $ value ] ) , ] ; } , 'property_path' => 'itemViewType' , ] + $ this -> getChoicesAsValuesOption ( ) ) ; }
Adds view type and item view type forms to the provided form builder.
Adds view type and item view type forms to the provided form builder .