contributte / forms-wizard

:tophat: Easy to use step-by-step form for Nette Framework
https://contributte.org/packages/contributte/forms-wizard.html
MIT License
15 stars 10 forks source link

Wizard reworked #11

Closed MartkCz closed 3 years ago

MartkCz commented 4 years ago

Sessions are managed by WizardSessionSection. Steps are in StepCounter.

Values are now two-dimensional (returned from Wizard::getRawValues()):

[
    step => values
]

Wizard::getValues() returns merged array (from Wizard::getRawValue()) and cleaned of skipped steps.

Total steps is determined without form creation.

Wizard now checks if submitted form is current form.

Added methods getPresenter() and startup().

Can make optional step with:

protected function startup(): void
{
    $this->skipStepIf(2, function (array $values): bool {
        return isset($values[1]) && $values[1]['skip'];
    });
}

Fixed #10, #9

vanam commented 3 years ago

Any update?

vanam commented 3 years ago

@MartkCz I took your PR and finished it. Please take a look #27. Thx

f3l1x commented 3 years ago

27 merged