diff --git a/src/Renderers/Bs3FormRenderer.php b/src/Renderers/Bs3FormRenderer.php index 38def74..5e41ddb 100644 --- a/src/Renderers/Bs3FormRenderer.php +++ b/src/Renderers/Bs3FormRenderer.php @@ -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(); diff --git a/src/Renderers/Bs4FormRenderer.php b/src/Renderers/Bs4FormRenderer.php index 2bdd4aa..d7eab9a 100644 --- a/src/Renderers/Bs4FormRenderer.php +++ b/src/Renderers/Bs4FormRenderer.php @@ -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();