2017 © Pedro Peláez
 

yii2-extension yii2-wizard

Yii2 extension to handle multi-form wizards

image

beastbytes/yii2-wizard

Yii2 extension to handle multi-form wizards

  • Monday, October 19, 2015
  • by BeastBytes
  • Repository
  • 12 Watchers
  • 35 Stars
  • 4,956 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 21 Forks
  • 14 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

yii2-wizard

Yii2 Extension to handle multi-form wizards., (*1)

Features

  • All forms submit to the same route - user friendly URLs
  • Next/Previous or Forward Only navigation - registration forms will probably use Next/Previous navigation; tests will probably use Forward Only
  • Looping - repeat one or more steps on a form as many times as needed
  • Plot Branching Navigation (PBN) - allows the form to decide which path to take depending on a user's response to questions
  • Step timeout - steps can have a timeout to ensure a user responds within a given time
  • Save/Restore - save partially completed forms then restore and continue from that point later
  • Event driven - write the handler functions and hook them up to events

For license information see the LICENSE-file., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist beastbytes/yii2-wizard

or add, (*5)

"beastbytes/yii2-wizard": "*"

to the require section of your composer.json., (*6)

Usage

Below is a very short overview of how to use the extension; the examples folder shows how to implement PBN, looping, forward only navigation, and step timeout in examples of a quiz, survey, and registration., (*7)

Attach WizardBehavior to a controller., (*8)

The controller contains the event handlers; the two most important events are WizardBehavior::EVENT_WIZARD_STEP and WizardBehavior::EVENT_AFTER_WIZARD, these are responsible for handling the steps of the wizard and processing the data at the end of the wizard respectively., (*9)

Controller Action

The controller action is very simple:, (*10)

public function actionWizard($step = null)
{
    return $this->step($step);
}

WizardBehavior::EVENT_WIZARD_STEP

This event's handler is responsible for validating submitted data and deciding in what direction the Wizard should proceed; this and the data to be stored is placed into the event. When the event is marked as handled by handler the wizard will take the appropriate action., (*11)

WizardBehavior::EVENT_AFTER_WIZARD

The handler for this event is responsible for taking the required action once the Wizard has completed; this could be rendering a page based on the user input and/or saving the data to persistant storage., (*12)

The Versions

19/10 2015

dev-master

9999999-dev

Yii2 extension to handle multi-form wizards

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Yates

yii2 form behavior forms wizard

26/07 2015

v1.0.0

1.0.0.0

Yii2 extension to handle multi-form wizards

  Sources   Download

BSD-3-Clause

The Requires

 

by Chris Yates

yii2 form behavior forms wizard