Wizard Help

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()

stopWizard() called

stopWizard() not called

Controller

Wizard

BeforeWizard

AfterWizard

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

step()

Step1 GET Request

Step1 POST Request

StepN GET Request

StepN POST Request

Step1 form submitted

StepN form submitted

Controller

Wizard

Step

Render_Step1_Form

Manage_Step1_Data

Render_StepN_Form

Manage_StepN_Data

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

step()

StepN GET Request

StepN POST Request & step timeout expired

StepN form submitted

Go to step expired action

Controller

Wizard

Render_StepN_Form

StepExpired

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.

AfterWizard State Diagram

step()

Steps to process

StepN GET Request

StepN POST Request

StepN form submitted

All steps processed

Go to after wizard action

Controller

Wizard

Render_StepN_Form

Manage_StepN_Data

AfterWizard

Last modified: 27 January 2025