Step Event
The Step event is raised when the Wizard processes a step.
The event is raised at least twice for each step processed:
When the form is first rendered; request method is GET
When the form is submitted; request method is POST
It the form contains errors the event is raised again on subsequent form submissions.
Namespace | BeastBytes\Wizard\Event |
---|---|
Inherits | |
Uses |
Methods
Name | Description |
---|---|
__construct() | Event constructor |
getBranches() | Returns a map defining which branches are enabled and/or disabled |
getData() | Returns data for the current step |
getGoto() | Returns a value indicating which step Wizard is to process next |
getResponse() | Returns the response |
getWizard() | Returns the Wizard instance that raised the event |
hasData() | Returns a value indicating if the event contains data for the current step |
isPropagationStopped() | Returns a value indicating whether event propagation is stopped |
isWizardStopped() | Returns a value indicating whether the wizard is stopped |
setBranches() | Set which branches are enabled and/or disabled |
setData() | Set the data for the current step |
setGoto() | Set the step that Wizard should process next |
setResponse() | Sets the response |
stopPropagation() | Stops event propagation |
stopWizard() | Stops the wizard |
Method Details
__construct()
Constructor
Parameter | Type | Default | Description |
---|---|---|---|
$wizard | WizardInterface | Required | The Wizard instance that raised the event |
getBranches()
Returns a map that defines which branches are enabled and/or disabled.
See also:
Return | array[string => Wizard::BRANCH_DISABLED | Wizard::BRANCH_ENABLED] |
---|
getData()
Returns the data for the current step.
See also:
Return | array | Data that has been set |
---|
getGoto()
Return which step Wizard is to process next.
See also:
Return | int|string | Which step the Wizard process next Wizard::DIRECTION_BACKWARD - the previous step Wizard::DIRECTION_FORWARD - the next step Wizard::DIRECTION_REPEAT - repeat the current step string: the name of the next step to process |
---|
getResponse()
Returns the response.
See also:
Return | ?ResponseInterface | The response or null if no response is set |
---|
getWizard()
Returns the Wizard instance that raised the event.
Return | WizardInterface | The Wizard instance that raised the event |
---|
hasData()
See also:
Return | bool | Whether the event contains data |
---|
isPropagationStopped()
Returns a value indicating whether event propagation is stopped.
See also:
Return | bool | Whether event propagation is stopped false: if event propagation is not stopped true: if event propagation is stopped |
---|
isWizardStopped()
Returns a value indicating whether the Wizard is stopped
See also:
Return | bool | Whether the Wizard is stopped false: if the Wizard is not stopped true: if the Wizard is stopped |
---|
setBranches()
See also:
Parameter | Type | Default | Description |
---|---|---|---|
$branches | array | Required | A map that defines which branches are enabled and/or disabled Keys are branch names Values are either Wizard::BRANCH_DISABLED or Wizard::BRANCH_ENABLED |
setData()
Set the data for the current step.
See also:
Parameter | Type | Default | Description |
---|---|---|---|
$data | mixed | Required | The data |
setGoto()
Set which step the Wizard should process next.
See also:
Parameter | Type | Default | Description |
---|---|---|---|
$goto | int|string | Wizard::DIRECTION_FORWARD | Which step the Wizard process next Wizard::DIRECTION_BACKWARD - the previous step Wizard::DIRECTION_FORWARD - the next step Wizard::DIRECTION_REPEAT - repeat the current step string: the name of the next step to process |
setResponse()
Sets the response.
See also:
Parameter | Type | Default | Description |
---|---|---|---|
$response | ResponseInterface | Required | The response |
stopPropagation()
Stops event propagation.
See also: isPropagationStopped()
stopWizard()
Stops the Wizard.
See also: