winzik/docs/ide/images/symfony-forms-diff.png
David Nurdin e796498ed1 IDE: Symfony Forms window, a visual form builder for FormTypes
- The Symfony Forms window (projects requiring symfony/form): the project's FormTypes, New form type, twig.yaml's form themes.
- The form builder: fields added from Symfony's types and the project's own (sub-forms), reordered by dragging, removed; each
  type's options edited by kind (label, required, help, attr / row_attr, validator constraints with their options, choices,
  EntityType class / query_builder, CollectionType entry_type / allow_add / allow_delete / by_reference / prototype, RepeatedType,
  date widgets / html5...), configureOptions, form events (listener methods made), data transformers (classes made).
- Add fields from the class: an entity's / DTO's properties with suggested types (Doctrine columns, relations -> EntityType /
  CollectionType, enums, PHP types, names).
- Preview without PHP: the HTML of form_div_layout, form_table_layout, bootstrap_5_layout, tailwind_2_layout with Symfony's ids /
  names, sub-forms, collection prototypes and "Show errors", in the project's base.html.twig with its CSS.
- Round trip: FormTypes read back with php-parser (add() chains, option arrays, conditionals / closures kept locked) and written
  by text edits at php-parser's positions: only what changed, the rest byte for byte; new FormTypes as maker-bundle writes them.
- Generate the controller action (createForm, handleRequest, persist / flush or DTO, flash, redirect) into an existing or new
  controller and its Twig template; every change shown as a diff first.
- ide/src/Symfony/Form*.php + Imports.php (forms.* commands), ide/ui/js/symfony-forms*.js, css/symfony-forms.css; 14 languages.
- Tests: SymfonyFormsTest (exact generated code, parsing, byte-identical round trips, edits, suggestions, generators),
  symfony-forms-preview.test.mjs (HTML per theme), games/ide/tools/ui-forms-check.sh (screenshots); checked on a Symfony 8.1
  project (debug:form, GET renders the fields, invalid POST 422 with the message, valid POST 303 + flash).
- Docs: docs/ide/symfony-forms.md (+ fr), docs/ide.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JkYTqsvYu6AYr9yQ3Q4Nt6
2026-11-16 00:35:45 +01:00

118 KiB
1280x820px