From e68379a4e7488936b97c81ea3334aec51e8ab9ff Mon Sep 17 00:00:00 2001 From: Andre Schuurman Date: Tue, 10 Nov 2015 18:07:48 +0100 Subject: [PATCH] HTML option for buttons. Completed configuration documentation. --- README.md | 33 ++++++++++++++++++++++++++++++++- WizardWidget.php | 4 +++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e05282d..f4c6299 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Yii2 Wizard Widget ================== Multi step wizard widget using tabs to guide a user through steps to complete a task. Based on the Form wizard (using tabs) from lukepzak (see http://bootsnipp.com/snippets/featured/form-wizard-using-tabs). + Installation ------------ @@ -22,10 +23,40 @@ or add to the require section of your `composer.json` file. +Wizard configuration +-------------------- + +- `id`: *string* html id of the wizard widget +- `steps`: *array* definition of the wizard steps. Array key will be used as the hyperlinks to the steps. + +Each step can have the following parameters: +- `title`: *string required* title of the step (shown when hoovering over step icon) +- `icon`: *string required* step icon code (see Glyphicon or Font awesome codes) +- `content`: *string required* HTML content of the step page +- `skippable`: *boolean optional* allow to skip over a step +- `buttons`: *array optional* configuration of the buttons per step +- `complete_content`: *string optional* the HTML content of a complete step +- `start_step`: *string optional* the starting step when wizard is initialized + +In each step four different buttons can be configured (display of a button is dependent on position of the step in the sequence): +- `previous`: (not shown on first step) +- `next`: (not shown on last step) +- `skip`: (shown when skippable is set) +- `save`: (shown on the last step) + +Each button can be configured with: +- `title`: *string optional* title as shown in the button +- `options`: *array optional* of HTML options (see [Yii2 HTML helper documentation](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#button()-detail)) + +or + +- `html`: *string optional* add your own button definition with HTML code (for example to save data after a step) + + Usage ----- -Once the extension is installed, simply use it in your code by : +Once the extension is installed, use it in your code like : ```php default_buttons[ $button_type ]['title'], $options);