1- # Form wizard for nette/forms
1+ # nette/forms wizard
22[ ![ Build Status] ( https://travis-ci.org/WebChemistry/wizard.svg?branch=master )] ( https://travis-ci.org/WebChemistry/wizard )
33
44## Installation
88composer require webchemistry/forms-wizard
99```
1010
11+ ** php 5.6**
12+ ```
13+ composer require webchemistry/forms-wizard:^1.2
14+ ```
15+
1116** Config**
1217
1318``` yaml
@@ -20,13 +25,16 @@ extensions:
2025## Component
2126
2227` ` ` php
28+
29+ use Nette\Application\UI\Form;
30+
2331class Wizard extends WebChemistry\Forms\Controls\Wizard {
2432
25- protected function finish() {
33+ protected function finish() : void {
2634 $values = $this->getValues();
2735 }
2836
29- protected function createStep1() {
37+ protected function createStep1() : Form {
3038 $form = $this->getForm();
3139
3240 $form->addText('name', 'User name')
@@ -37,7 +45,7 @@ class Wizard extends WebChemistry\Forms\Controls\Wizard {
3745 return $form;
3846 }
3947
40- protected function createStep2() {
48+ protected function createStep2() : Form {
4149 $form = $this->getForm();
4250
4351 $form->addText('email', 'Email')
@@ -69,12 +77,13 @@ class HomepagePresenter extends Nette\Application\UI\Presenter {
6977 $this->wizard = $wizard;
7078 }
7179
72- public function handleChangeStep($step) {
80+ public function handleChangeStep($step) : void {
7381 $this->getComponent("wizard")->setStep($step);
74- //$this->redirect("this"); // Optional, hides parameter from URL
82+
83+ $this->redirect("this"); // Optional, hides parameter from URL
7584 }
7685
77- protected function createComponentWizard() {
86+ protected function createComponentWizard() : Wizard {
7887 return $this->wizard;
7988 }
8089
0 commit comments