appolodev / form-builder-bundle
Moteur de formulaires personnalisés pour Symfony : structure, rendu, réponses et export
Package info
github.com/AppoloDev/form-builder-bundle
Type:symfony-bundle
pkg:composer/appolodev/form-builder-bundle
Requires
- php: >=8.4
- doctrine/doctrine-bundle: ^2.0 || ^3.0
- doctrine/orm: ^3.0
- doctrine/persistence: ^3.0 || ^4.0
- psr/container: ^2.0
- psr/log: ^2.0 || ^3.0
- symfony/config: ^8.1
- symfony/dependency-injection: ^8.1
- symfony/doctrine-bridge: ^8.1
- symfony/filesystem: ^8.1
- symfony/form: ^8.1
- symfony/framework-bundle: ^8.1
- symfony/http-foundation: ^8.1
- symfony/http-kernel: ^8.1
- symfony/mime: ^8.1
- symfony/uid: ^8.1
- symfony/ux-icons: ^3.0
- symfony/validator: ^8.1
- twig/twig: ^3.0
Requires (Dev)
Suggests
- symfony/stimulus-bundle: Requis pour les contrôleurs Stimulus du bundle
- symfony/ux-autocomplete: Autocomplétion et saisie libre (`customOption`) des listes déroulantes ; sans lui, liste native
Provides
None
Conflicts
None
Replaces
None
README
Symfony bundle that lets users build custom forms (React builder), then renders them as Symfony forms, stores the answers, and displays them.
| Concern | Provided by the bundle | Left to your app |
|---|---|---|
| Form structure | Base entities, sync use cases, FormStructureType (embeds the builder) |
Concrete entities, controllers, access control |
| Answering | FormTypeGenerator (structure → Symfony form), AbstractFormAnswer::setAnswerData() |
Routes, persistence, extra columns (company, user…) |
| Display | form_builder_answers() Twig function + templates |
Layout, PDF styling |
| Files / signatures | Upload storage, cleanup listener | Download route and voter |
| Front | Builder (React), custom elements, Stimulus controllers | Vite/Tailwind wiring |
No controllers, routes, voters or migrations are shipped.
Requirements
- PHP ≥ 8.4, Symfony 8.1, Doctrine ORM 3,
symfony/uid(entity ids areUuid) - The default form theme and answers template are neutral (plain HTML, generic classes); the only UI dependency is
symfony/ux-icons(<twig:ux:icon>for the PDF icon in answers). - Optional:
symfony/ux-autocomplete(searchable lists and free entry forSelect; native lists without it). - Front: Vite (or any bundler handling TSX), Tailwind 4, Stimulus.
Install
composer require appolodev/form-builder-bundle
Then follow docs/installation.md.
Form theme
The default theme (@FormBuilder/form_theme/default.html.twig) is neutral. For a design system, create a theme in
the application and declare it via form_builder.form_theme. Blocks to override: fieldset_row, title_row,
paragraph_row, repeatable_row, repeatable_child_row, add_btn, remove_btn, address_row, signature_row,
file_repeatable_row, file_repeatable_child_row, form_builder_conditional_field_row (plus the
*_children_prototype helper blocks). structure.html.twig is always loaded by the bundle. Keep the data-*
attributes and the classes read by the Stimulus controllers (repeatable, repeatable--item, collec_child,
repeatable_child, file_child, file-name, remove-container, input-delete). The former
form_theme/shadcn.html.twig name remains as an alias of the default theme.
Documentation
- Installation — entities, configuration, front wiring
- Usage — admin, answering, display, files, PDF
- Reference — configuration, services, Twig, data shapes, field types
- Front end — custom elements, Stimulus controllers, builder
skills/form-builder-integration— Claude Code skill (backend/front model + integration checklist). Install: copy the folder to.claude/skills/of your project.
Development
composer install composer qa # php-cs-fixer + PHPStan (max, strict rules) + PHPUnit pnpm install pnpm run typecheck # tsc --noEmit on assets/builder pnpm run test # vitest, including the front/PHP contract check pnpm run export-contract # regenerate assets/builder/contract/blocks.json after changing a block
CI runs the same on PHP 8.4 and 8.5, plus the front checks. Tests are standalone unit tests; host entities are simulated by
tests/Fixtures.
License
MIT