Skip to content

Commit 480e6a5

Browse files
authored
Merge pull request #1 from robskr/fix-rendering-multiple-forms
Fix rendering second and following forms
2 parents 9333347 + b935729 commit 480e6a5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Renderers/Bs3FormRenderer.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ public function __construct()
4242
}
4343

4444

45+
public function render(Form $form, string $mode = null): string
46+
{
47+
if ($this->form !== $form) {
48+
$this->controlsInit = false;
49+
}
50+
51+
return parent::render($form, $mode);
52+
}
53+
54+
4555
public function renderBegin(): string
4656
{
4757
$this->controlsInit();

src/Renderers/Bs4FormRenderer.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ public function __construct($layout = FormLayout::HORIZONTAL)
6060
}
6161

6262

63+
public function render(Form $form, string $mode = null): string
64+
{
65+
if ($this->form !== $form) {
66+
$this->controlsInit = false;
67+
}
68+
69+
return parent::render($form, $mode);
70+
}
71+
72+
6373
public function renderBegin(): string
6474
{
6575
$this->controlsInit();

0 commit comments

Comments
 (0)