Events
Wizard uses events to manage which step is being processed, displaying forms, collecting and providing collected data.
All event handlers receive the Wizard instance; they are typically declared in the controller.
The Wizard raises the following events:
BeforeWizard
Raised the first time Wizard::step()
is called.
To prevent the Wizard from running, call BeforeWizard::stopWizard()
in the event handler.
Handling the BeforeWizard event is optional.
BeforeWizard State Diagram
Step
The Step event is raised at least twice for every step in the Wizard.
The first time it is raised in a step the event handler renders a form. The event is raised again on form submission when the event handler validates the form and either saves the form data or re-renders the form, depending on the validation result.
The Step event must be handled.
Step State Diagram
StepExpired
If the Wizard is configured with a step timeout, the StepExpired event is raised if a step times out.
The StepExpired event must be handled if a step timeout is set.
StepExpired State Diagram
AfterWizard
The AfterWizard is raised when the Wizard stops. This may be because the Wizard has completed or an event handler has stopped the Wizard.
The AfterWizard event must be handled.