Skip to content

Form Component Through the Ages: History of (not so) Black Magic

Avatar of Benjamin Georgeault Benjamin Georgeault

`$form->handleRequest($request);`

One line, and somehow your data is hydrated, validated, CSRF-protected and ready to be persisted.

The Form component is probably the most powerful and the most misunderstood piece of Symfony. We use it every day, we copy-paste code like `'by_reference' => false` without really understanding what it does, and we cross our fingers when a data transformer doesn't fire. Black magic? Not quite.

Each "magic" behavior of the Form component has a story behind it: a problem it solved, a version it landed in, a trade-off someone had to make. Let's travel through 15 years of Symfony forms to understand why they work the way they do:
- The origins: How its start and how it gave birth to other components you use every day.
- Under the hood: Type inheritance vs. type extensions, type guessing, data transformers/mappers, form events, etc…
- Last year (7.4): Multi-step form, create your own (black magic) wizard.
- Today (8.2): Attribute-based forms, and why this brand-new syntax stands on the very same foundations.

Whether you love forms or avoid them, you'll leave this session reading the Form component like an open book rather than a spellbook.

Delivered in English

Date/time to be announced