buttflattery / yii2-formwizard

A Yii2 plugin used for creating stepped form or form wizard using yii\widgets\ActiveForm and \yii\db\ActiveRecord
https://yii2plugins.omaraslam.com/formwizard
Other
96 stars 13 forks source link
form-wizard javascript php plugin-smartwizard smartwizard tabular-steps wizard yii2-extension yii2-formwizard yii2-plugin yii2-plugins yii2-widget

Yii2-FormWizard (v1.7.9)

What is this repository for?

A Yii2 plugin used for creating stepped form or form wizard using yii\widgets\ActiveForm and \yii\db\ActiveRecord, it uses smart wizard library for creating the form interface that uses 3 builtin and 3 extra themes, moreover you can also create your own customized theme too.

Note : It uses limited features of the jquery plugin SmartWizard that suite the needs of the ActiveForm validation so not all options in the javascript plugin library are allowed to be changed or customized from within this plugin.

preview

External Libraries Used


New Features Added

19th Jan, 2020 : Enable Edit Mode

11th Jan, 2020 : Skip Step Validation

24th April, 2019 : Group Step Fields

2nd April, 2019 : Enable Persistence

25th March, 2019 : Preview Step, Tabular Step


About Bootstrap Version Usage

The extension detects if you are using the yiisoft/yii2-bootstrap or yiisoft/yii2-bootstrap4 and loads the appropriate assets for the extension. It will check first the "yiisoft/yii2-bootstrap4" if it exists then it will load bootstrap4 resources otherwise it will fall back to use bootstrap3. So make sure you are following the correct guide to use the yiisoft/yii2-bootstrap4" and remove the "yiisoft/yii2-bootstrap": "~2.0.0", from you composer.json and change the minimum-stability:"dev" here is the complete guide.

How do I get set up

use composer to install the extension

php composer.phar require  buttflattery/yii2-formwizard "@dev"

or add into the composer.json file under require section

"buttflattery/yii2-formwizard":"@dev"

Demos for all the Features & Themes

Docs

Available Options

Widget options

wizardContainerId (string)

Id of the main container for the wizard.

forceBsVersion (int) (since V1.5.0)

Force use of the bootstrap version in case you have some extension having dependencies on yiisoft\yii2-bootstrap4 even though you are using yiisoft\yii2-bootstrap on the site overall, since the extension checks for yii2-bootstrap4 first and if it finds it will load the yii2-bootstrap4 assets and having both of the extensions installed the widget will always go for the bootstrap4. although we dont recommend doing that but still there are scenarios wher people are using in this manner and fce layout problems. default value for this option is false which means widget will detect automatically, you can use the provided constants FormWizard::BS_3 or FormWizard::BS_4.

editMode (boolean) (since V1.6.4)

if form wizard should be loaded in edit mode. Default value is false. see wiki for details.

formOptions (array)

Specify the ActiveForm properties.

labelNext (string)

Next button label, default value Next.

labelPrev (string)

Previous button label, default value Previous.

labelFinish (string)

Finish button label, default value Finish.

labelAddRow (string)

Add button label for tabular step, default value Add.

classNext (string)

Css classes for the button Next, default btn btn-info.

iconNext (string)

The html string for the Next button, defaults to <i class="formwizard-arrow-right-alt1-ico"></i>.

classPrev (string)

Css classes for the button Previous, default btn btn-info.

iconPrev (string)

The html string for the prev icon, defaults to <i class="formwizard-arrow-left-alt1-ico"></i>.

classFinish (string)

Css classes for the button Finish, default btn btn-success.

iconFinish (string)

The Html string for the icon, defaults to <i class="formwizard-check-alt-ico"></i>.

classAdd (string)

Css class for Add Row Button default to btn btn-info

iconAdd (string)

The html string for the button default to <i class="formwizard-plus-ico"></i>

enablePreview (boolean) (since V1.2.0)

Adds a Preview Step as the last step in the form wizard where you can preview all the entered inputs grouped by steps, clicking on any step will navigate to that step for quick edit, it defaults to false. See Wiki For Code Samples

When using 'enablePreview'=>true you can customize the classes using the below options.

enablePersistence (boolean) (since V1.3.0)

Enables to save and restore an un-saved form to the local storage for later use, defaults to false.

steps (array)

An array of the steps(array), the steps can have models dedicated to each step, or a single model for all steps. Following options are recognized when specifying a step.

Widget Plugin (SmartWizard) Options

Only the following options of the plugin SmartWizard are allowed to be customized

theme

Name of the theme to be used, there are mainly 6 themes supported by the plugin

transitionEffect (string)

The effect used when sliding the step it can be one of the

showStepURLhash (boolean)

Show url hash based on step, default false.

useURLHash (boolean)

Enable selection of the step based on url hash, default value is false.

toolbarPosition

Position of the toolbar (none, top, bottom, both), default value top.

toolbarButtonPosition

Position of the toolbar buttons (left, right), default value is left.

toolbarExtraButtons

Specify the extra buttons and its events to show on toolbar.

markDoneSteps (boolean)

Make already visited steps as done, default value is true.

markAllPreviousStepsAsDone (boolean)

When a step selected by url hash, all previous steps are marked done, default value is true.

removeDoneStepOnNavigateBack (boolean)

While navigate back done step after active step will be cleared, default value is false.

enableAnchorOnDoneStep (boolean)

Enable/Disable the done steps navigation, default value is true.

Widget Constants

Icons

Boostrap Versions

Step Types

Themes

Who do I talk to?