{"id":22765713,"url":"https://github.com/mindyphp/formbundle","last_synced_at":"2025-03-30T10:21:43.003Z","repository":{"id":62529141,"uuid":"81187116","full_name":"MindyPHP/FormBundle","owner":"MindyPHP","description":"FormBundle","archived":false,"fork":false,"pushed_at":"2018-02-26T13:55:56.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-06T08:58:07.539Z","etag":null,"topics":["form","mindy-bundle","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MindyPHP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-07T08:52:44.000Z","updated_at":"2018-01-14T15:57:39.000Z","dependencies_parsed_at":"2022-11-02T16:15:37.745Z","dependency_job_id":null,"html_url":"https://github.com/MindyPHP/FormBundle","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindyPHP%2FFormBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindyPHP%2FFormBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindyPHP%2FFormBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindyPHP%2FFormBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MindyPHP","download_url":"https://codeload.github.com/MindyPHP/FormBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246303082,"owners_count":20755713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["form","mindy-bundle","php"],"created_at":"2024-12-11T12:14:08.490Z","updated_at":"2025-03-30T10:21:42.983Z","avatar_url":"https://github.com/MindyPHP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Form Bundle\n\n[![Build Status](https://travis-ci.org/MindyPHP/FormBundle.svg?branch=master)](https://travis-ci.org/MindyPHP/FormBundle)\n[![codecov](https://codecov.io/gh/MindyPHP/FormBundle/branch/master/graph/badge.svg)](https://codecov.io/gh/MindyPHP/FormBundle)\n[![Latest Stable Version](https://poser.pugx.org/mindy/form-bundle/v/stable.svg)](https://packagist.org/packages/mindy/form-bundle)\n[![Total Downloads](https://poser.pugx.org/mindy/form-bundle/downloads.svg)](https://packagist.org/packages/mindy/form-bundle)\n\nThe Form Bundle\n\nResources\n---------\n\n  * [Documentation](https://mindy-cms.com/doc/current/bundles/form/index.html)\n  * [Contributing](https://mindy-cms.com/doc/current/contributing/index.html)\n  * [Report issues](https://github.com/MindyPHP/mindy/issues) and\n    [send Pull Requests](https://github.com/MindyPHP/mindy/pulls)\n    in the [main Mindy repository](https://github.com/MindyPHP/mindy)\n\n### FieldsetType\n\n```php\n    public function buildForm(FormBuilderInterface $builder, array $options)\n    {\n        $instance = $builder-\u003egetData();\n\n        $builder\n            -\u003eadd('fieldset_1', FieldsetType::class, [\n                'legend' =\u003e 'Информация',\n                'fields' =\u003e function (FormBuilderInterface $builder) use ($instance) {\n                    $builder\n                        -\u003eadd('parent', ChoiceType::class, [\n                            'label' =\u003e 'Родительская категория',\n                            'required' =\u003e false,\n                            'choices' =\u003e Category::objects()-\u003eorder(['root', 'lft'])-\u003eall(),\n                            'choice_label' =\u003e function ($page) {\n                                return sprintf('%s %s', str_repeat('-', $page-\u003elevel - 1), $page);\n                            },\n                            'choice_value' =\u003e 'id',\n                            'choice_attr' =\u003e function ($page) use ($instance) {\n                                return $page-\u003epk == $instance-\u003epk ? ['disabled' =\u003e 'disabled'] : [];\n                            },\n                        ])\n                        -\u003eadd('name', TextType::class, [\n                            'label' =\u003e 'Название',\n                        ])\n                        -\u003eadd('image', FileType::class, [\n                            'label' =\u003e 'Изображение',\n                            'required' =\u003e false,\n                            'constraints' =\u003e [\n                                new Assert\\File([\n                                ]),\n                            ],\n                        ])\n                        -\u003eadd('show_category', CheckboxType::class, [\n                            'label' =\u003e 'Отображать дочерние категории (Если выключено, то отображаются только товары)',\n                            'required' =\u003e false,\n                        ])\n                        -\u003eadd('seo', SeoFormType::class, [\n                            'label' =\u003e 'Мета информация',\n                            'source' =\u003e $instance,\n                            'mapped' =\u003e false,\n                        ]);\n                }\n            ])\n            -\u003eadd('submit', SubmitType::class, [\n                'label' =\u003e 'Сохранить',\n            ])\n            -\u003eadd('submit_create', SubmitType::class, [\n                'label' =\u003e 'Сохранить и создать',\n            ]);\n    }\n```\n\n### TabsType \u0026 TabType\n\n```php\n    public function buildForm(FormBuilderInterface $builder, array $options)\n    {\n        $instance = $builder-\u003egetData();\n\n        $builder\n            -\u003eadd('tabs', TabsType::class, [\n                'tabs' =\u003e function (FormBuilderInterface $builder) use ($instance) {\n                    $builder\n                        -\u003eadd('first', TabType::class, [\n                            'tab' =\u003e 'Информация',\n                            'fields' =\u003e function (FormBuilderInterface $builder) use ($instance) {\n                                $builder\n                                    -\u003eadd('parent', ChoiceType::class, [\n                                        'label' =\u003e 'Родительская категория',\n                                        'required' =\u003e false,\n                                        'choices' =\u003e Category::objects()-\u003eorder(['root', 'lft'])-\u003eall(),\n                                        'choice_label' =\u003e function ($page) {\n                                            return sprintf('%s %s', str_repeat('-', $page-\u003elevel - 1), $page);\n                                        },\n                                        'choice_value' =\u003e 'id',\n                                        'choice_attr' =\u003e function ($page) use ($instance) {\n                                            return $page-\u003epk == $instance-\u003epk ? ['disabled' =\u003e 'disabled'] : [];\n                                        },\n                                    ])\n                                    -\u003eadd('name', TextType::class, [\n                                        'label' =\u003e 'Название',\n                                    ])\n                                    -\u003eadd('image', FileType::class, [\n                                        'label' =\u003e 'Изображение',\n                                        'required' =\u003e false,\n                                        'constraints' =\u003e [\n                                            new Assert\\File([\n                                            ]),\n                                        ],\n                                    ])\n                                    -\u003eadd('show_category', CheckboxType::class, [\n                                        'label' =\u003e 'Отображать дочерние категории (Если выключено, то отображаются только товары)',\n                                        'required' =\u003e false,\n                                    ]);\n                            }\n                        ])\n                        -\u003eadd('seo', TabType::class, [\n                            'tab' =\u003e 'Мета информация',\n                            'fields' =\u003e function (FormBuilderInterface $builder) use ($instance) {\n                                $builder\n                                    -\u003eadd('seo', SeoFormType::class, [\n                                        'label' =\u003e 'Мета информация',\n                                        'source' =\u003e $instance,\n                                        'mapped' =\u003e false,\n                                    ]);\n                            }\n                        ]);\n                }\n            ])\n    \n            -\u003eadd('submit', SubmitType::class, [\n                'label' =\u003e 'Сохранить',\n            ])\n            -\u003eadd('submit_create', SubmitType::class, [\n                'label' =\u003e 'Сохранить и создать',\n            ]);\n    }\n```\n\n\n### ButtonsType\n\n```php\n    public function buildForm(FormBuilderInterface $builder, array $options)\n    {\n        $builder\n            -\u003eadd('buttons', ButtonsType::class, [\n                'buttons' =\u003e function (FormBuilderInterface $builder) {\n                    $builder\n                        -\u003eadd('submit', SubmitType::class, [\n                            'label' =\u003e 'Сохранить',\n                        ])\n                        -\u003eadd('submit_create', SubmitType::class, [\n                            'label' =\u003e 'Сохранить и создать',\n                        ]);\n                }\n            ])\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindyphp%2Fformbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindyphp%2Fformbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindyphp%2Fformbundle/lists"}