Skip to content

Commit 44fd190

Browse files
authored
Update README.md
1 parent 87514a1 commit 44fd190

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ composer require infinityloop-dev/multistep-form
2424
- Register `\Infinityloop\MultistepForm\IMultiStepFormFactory` as service in cofiguration file.
2525
- Inject it into component/presenter where you wish to use multi step form,
2626
- write createComponent method and use macro {control} in template file
27+
- Submit buttons for moving forward and backward are added automaticaly.
2728

2829
### Example createComponent method
2930

@@ -55,7 +56,7 @@ protected function createComponentMultistepForm() : \Infinityloop\MultistepForm\
5556
$form->setTranslator($this->translator);
5657
5758
if (\in_array($previousValues['action'], [\App\Enum\EAction::ACTION1, \App\Enum\EAction::ACTION2], true)) {
58-
$form->addAjaxSelect('action_1or2', 'Action 1 or 2')
59+
$form->addText('action_1or2', 'Action 1 or 2')
5960
->setRequired();
6061
} else {
6162
$form->addText('action_xyz', 'Action Xyz')
@@ -66,3 +67,13 @@ protected function createComponentMultistepForm() : \Infinityloop\MultistepForm\
6667
return $multistepForm;
6768
}
6869
```
70+
71+
### Options
72+
73+
- setDefaults(array)
74+
- set default values for your form, all steps at once
75+
- addFactory(callable, ?string)
76+
- first argument is factory function from which the form is created
77+
- second argument is custom template path
78+
- the standard `{control form}` is used if no template is specified for current step
79+
- in custom template you can manualy render each step using `{form form} ... {/form}`

0 commit comments

Comments
 (0)