Skip to content

Commit

Permalink
Merge pull request #1 from robskr/fix-rendering-multiple-forms
Browse files Browse the repository at this point in the history
Fix rendering second and following forms
  • Loading branch information
hrach committed Sep 29, 2019
2 parents 9333347 + b935729 commit 480e6a5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Renderers/Bs3FormRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ public function __construct()
}


public function render(Form $form, string $mode = null): string
{
if ($this->form !== $form) {
$this->controlsInit = false;
}

return parent::render($form, $mode);
}


public function renderBegin(): string
{
$this->controlsInit();
Expand Down
10 changes: 10 additions & 0 deletions src/Renderers/Bs4FormRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ public function __construct($layout = FormLayout::HORIZONTAL)
}


public function render(Form $form, string $mode = null): string
{
if ($this->form !== $form) {
$this->controlsInit = false;
}

return parent::render($form, $mode);
}


public function renderBegin(): string
{
$this->controlsInit();
Expand Down

0 comments on commit 480e6a5

Please sign in to comment.