Multi-step Form
Fill in three steps about yourself and your stack, go back and forth, and see a preview at the end. The inputs are #[Signal] properties; the step and the error message are #[Persist], server state the client never sees.
data-bind. They are hydrated onto the instance before each action runs.$this->step (a #[Persist] prop the view's data closure 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 when the page loads again.Step 1: The Basics
Signals
step
int server only initial: 1 #[Persist]: server-only current step (1 to 3). Drives which step UI is rendered.
error
string server only initial: empty string #[Persist]: server-only validation message set by next() on step-1 failure.
name
string tab scope initial: empty string #[Signal]: developer name, collected in step 1.
role
string tab scope initial: "Backend Dev" #[Signal]: selected role from the step-1 dropdown.
years
int tab scope initial: 3 #[Signal]: years of experience, from the step-1 range slider.
sphp … sother
bool tab scope initial: false Eight #[Signal] booleans, one per stack technology, bound to step-2 checkboxes.
editor
string tab scope initial: "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.