How does Repeater work?
When I press the button at the bottom, it just clears the first field. How do I get more than 1 item in the repeater? Is it broken? Or is it not doing what I thought it would be doing?
10 Replies
seems broken π
Quite a basic setup:
Solution
$form->statePath('data')
Hero
It was working for every other field, but I guess for repeater it's needed to define state path
Thanks!
You should declare all fields
public $test;
public $test2;
...
Or use statePath instead of thisDo you by any chance also know how
defaultItems()
works?It's not putting any default items
Is it it because of this note from the docs?
"Note that these default items are only created when the form is loaded without existing data."
Ah definitely, when I call
fill()
it seems to work
I guess I missed this step:
Slowly figuring things out haha, thanks for your patience