๐ช Multi-step Form
Composition API: client inputs are #[Signal], while the step and validation error are #[Persist] โ server-only state that survives between actions and drives the server-side re-render.
data-bind. They are hydrated onto the instance before each action runs.$this->step (a #[Persist] prop the callable view reads live), then calls sync() to re-render the current step. No stale-signal timing issues.$this->name; on failure it sets $this->error and re-renders the same step with the message shown.$ctx->setSessionData('wizard', โฆ) on every step. view() resumes from the session on reconnect.Step 1: The Basics
โก Signals
step
int Persist 1 #[Persist] โ server-only current step (1โ3). Drives which step UI is rendered.
error
string Persist "" #[Persist] โ server-only validation message set by next() on step-1 failure.
name
string TAB "" #[Signal] โ developer name, collected in step 1.
role
string TAB "Backend Dev" #[Signal] โ selected role from the step-1 dropdown.
years
int TAB 3 #[Signal] โ years of experience, from the step-1 range slider.
sphp โฆ sother
bool TAB false Eight #[Signal] booleans, one per stack technology, bound to step-2 checkboxes.
editor
string TAB "VS Code" #[Signal] โ favourite editor, selected in step 2.
๐ฏ Actions
next
Validates step 1, increments $this->step, saves to session, then $ctx->sync() renders the next step.
back
Decrements $this->step and re-renders. Signal values from the previous step are preserved.
restart
Resets every signal + #[Persist] prop to defaults, clears the session, and returns to step 1.
๐ Views
wizard.html.twig
Single template with step-conditional blocks. step/error are passed as plain view data; inputs use auto-injected signals.