Examples menu

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.

#[Persist] step & error: server-controlled state that is never sent to the client and never hydrated from it. Because the class instance lives as long as the tab's context, the step survives across Next/Back actions.
#[Signal] inputs: name, role, years, editor and the eight stack booleans are two-way bound via data-bind. They are hydrated onto the instance before each action runs.
$ctx->sync(): each action mutates $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.
Server-side validation: next() checks $this->name; on failure it sets $this->error and re-renders the same step with the message shown.
Session persistence: saveState() writes the current values to $ctx->setSessionData('wizard', …) on every step. view() resumes from the session when the page loads again.
block: 'demo': only the wizard block re-renders on each step change; the header and anatomy panel stay static in the DOM.
1 Basics 2 Stack 3 Preview

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.