From 494920f0e21ca4b6545fff9d9b1d2dff5ac92de5 Mon Sep 17 00:00:00 2001 From: Andre Schuurman Date: Tue, 20 Oct 2015 09:53:18 +0200 Subject: [PATCH] Added parameter to start with a specific step ('start_step'). --- README.md | 1 + WizardWidget.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 932a34f..83d0f04 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ $wizard_config = [ ], ], 'complete_content' => "You are done!", // Optional final screen + 'start_step' => 2, ]; ?> diff --git a/WizardWidget.php b/WizardWidget.php index 959aa5d..10f88c0 100644 --- a/WizardWidget.php +++ b/WizardWidget.php @@ -39,6 +39,11 @@ class WizardWidget extends Widget { */ public $steps = []; + /** + * @var integer step number to start with (range 1 to number of defined steps) + */ + public $start_step = 1; + /** * @var string optional final complete step content */ @@ -63,7 +68,7 @@ public function run() { foreach ($this->steps as $id => $step) { - $wizard_line .= ''; // Setup tab content (first tab is always active) - $tab_content .= '
'; + $tab_content .= '
'; $tab_content .= $step['content']; // Setup navigation buttons @@ -97,7 +102,7 @@ public function run() { $first = false; } - // Add a complete step if defined + // Add a completed step if defined if ($this->complete_content) { $wizard_line .= '