2017 © Pedro Peláez
 

symfony-bundle form-bundle

Mail bundle

image

mindy/form-bundle

Mail bundle

  • Monday, February 26, 2018
  • by max107
  • Repository
  • 0 Watchers
  • 1 Stars
  • 991 Installations
  • PHP
  • 14 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 31 Versions
  • 0 % Grown

The README.md

Form Bundle

Build Status codecov Latest Stable Version Total Downloads, (*1)

The Form Bundle, (*2)

Resources

FieldsetType

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $instance = $builder->getData();

        $builder
            ->add('fieldset_1', FieldsetType::class, [
                'legend' => 'Информация',
                'fields' => function (FormBuilderInterface $builder) use ($instance) {
                    $builder
                        ->add('parent', ChoiceType::class, [
                            'label' => 'Родительская категория',
                            'required' => false,
                            'choices' => Category::objects()->order(['root', 'lft'])->all(),
                            'choice_label' => function ($page) {
                                return sprintf('%s %s', str_repeat('-', $page->level - 1), $page);
                            },
                            'choice_value' => 'id',
                            'choice_attr' => function ($page) use ($instance) {
                                return $page->pk == $instance->pk ? ['disabled' => 'disabled'] : [];
                            },
                        ])
                        ->add('name', TextType::class, [
                            'label' => 'Название',
                        ])
                        ->add('image', FileType::class, [
                            'label' => 'Изображение',
                            'required' => false,
                            'constraints' => [
                                new Assert\File([
                                ]),
                            ],
                        ])
                        ->add('show_category', CheckboxType::class, [
                            'label' => 'Отображать дочерние категории (Если выключено, то отображаются только товары)',
                            'required' => false,
                        ])
                        ->add('seo', SeoFormType::class, [
                            'label' => 'Мета информация',
                            'source' => $instance,
                            'mapped' => false,
                        ]);
                }
            ])
            ->add('submit', SubmitType::class, [
                'label' => 'Сохранить',
            ])
            ->add('submit_create', SubmitType::class, [
                'label' => 'Сохранить и создать',
            ]);
    }

TabsType & TabType

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $instance = $builder->getData();

        $builder
            ->add('tabs', TabsType::class, [
                'tabs' => function (FormBuilderInterface $builder) use ($instance) {
                    $builder
                        ->add('first', TabType::class, [
                            'tab' => 'Информация',
                            'fields' => function (FormBuilderInterface $builder) use ($instance) {
                                $builder
                                    ->add('parent', ChoiceType::class, [
                                        'label' => 'Родительская категория',
                                        'required' => false,
                                        'choices' => Category::objects()->order(['root', 'lft'])->all(),
                                        'choice_label' => function ($page) {
                                            return sprintf('%s %s', str_repeat('-', $page->level - 1), $page);
                                        },
                                        'choice_value' => 'id',
                                        'choice_attr' => function ($page) use ($instance) {
                                            return $page->pk == $instance->pk ? ['disabled' => 'disabled'] : [];
                                        },
                                    ])
                                    ->add('name', TextType::class, [
                                        'label' => 'Название',
                                    ])
                                    ->add('image', FileType::class, [
                                        'label' => 'Изображение',
                                        'required' => false,
                                        'constraints' => [
                                            new Assert\File([
                                            ]),
                                        ],
                                    ])
                                    ->add('show_category', CheckboxType::class, [
                                        'label' => 'Отображать дочерние категории (Если выключено, то отображаются только товары)',
                                        'required' => false,
                                    ]);
                            }
                        ])
                        ->add('seo', TabType::class, [
                            'tab' => 'Мета информация',
                            'fields' => function (FormBuilderInterface $builder) use ($instance) {
                                $builder
                                    ->add('seo', SeoFormType::class, [
                                        'label' => 'Мета информация',
                                        'source' => $instance,
                                        'mapped' => false,
                                    ]);
                            }
                        ]);
                }
            ])

            ->add('submit', SubmitType::class, [
                'label' => 'Сохранить',
            ])
            ->add('submit_create', SubmitType::class, [
                'label' => 'Сохранить и создать',
            ]);
    }

ButtonsType

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('buttons', ButtonsType::class, [
                'buttons' => function (FormBuilderInterface $builder) {
                    $builder
                        ->add('submit', SubmitType::class, [
                            'label' => 'Сохранить',
                        ])
                        ->add('submit_create', SubmitType::class, [
                            'label' => 'Сохранить и создать',
                        ]);
                }
            ])
    }

The Versions

16/11 2017

3.7.0.29

3.7.0.29

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

16/10 2017

3.7.0.26

3.7.0.26

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

16/10 2017

3.7.0.27

3.7.0.27

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

16/10 2017

3.7.0.28

3.7.0.28

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

22/09 2017

3.7.0.25

3.7.0.25

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

05/09 2017

3.7.0.24

3.7.0.24

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

29/06 2017

3.7.0.22

3.7.0.22

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

29/06 2017

3.7.0.23

3.7.0.23

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

09/04 2017

3.7.0.18

3.7.0.18

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

09/04 2017

3.7.0.19

3.7.0.19

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

09/04 2017

3.7.0.20

3.7.0.20

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

09/04 2017

3.7.0.21

3.7.0.21

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

22/03 2017

3.7.0.14

3.7.0.14

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

22/03 2017

3.7.0.15

3.7.0.15

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

22/03 2017

3.7.0.16

3.7.0.16

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

22/03 2017

3.7.0.17

3.7.0.17

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

15/03 2017

3.7.0.12

3.7.0.12

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

15/03 2017

3.7.0.13

3.7.0.13

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

14/03 2017

3.7.0.10

3.7.0.10

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim

14/03 2017

3.7.0.11

3.7.0.11

Mail bundle

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falaleev Maxim