Skip to content

Commit 728c43e

Browse files
committed
DefaultFormRenderer, FormsLatte: hidden fields are marked via option 'hidden' instead of class type HiddenField
1 parent ffb3b6b commit 728c43e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Bridges/FormsLatte/Runtime.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public static function renderFormEnd(Form $form, $withTags = TRUE)
5656
}
5757
}
5858

59-
foreach ($form->getComponents(TRUE, Nette\Forms\Controls\HiddenField::class) as $control) {
60-
if (!$control->getOption('rendered')) {
59+
foreach ($form->getControls() as $control) {
60+
if ($control->getOption('type') === 'hidden' && !$control->getOption('rendered')) {
6161
$s .= $control->getControl();
6262
}
6363
}

src/Forms/Rendering/DefaultFormRenderer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function renderEnd()
189189
{
190190
$s = '';
191191
foreach ($this->form->getControls() as $control) {
192-
if ($control instanceof Nette\Forms\Controls\HiddenField && !$control->getOption('rendered')) {
192+
if ($control->getOption('type') === 'hidden' && !$control->getOption('rendered')) {
193193
$s .= $control->getControl();
194194
}
195195
}
@@ -312,7 +312,7 @@ public function renderControls($parent)
312312

313313
$buttons = NULL;
314314
foreach ($parent->getControls() as $control) {
315-
if ($control->getOption('rendered') || $control instanceof Nette\Forms\Controls\HiddenField || $control->getForm(FALSE) !== $this->form) {
315+
if ($control->getOption('rendered') || $control->getOption('type') === 'hidden' || $control->getForm(FALSE) !== $this->form) {
316316
// skip
317317

318318
} elseif ($control instanceof Nette\Forms\Controls\Button) {

0 commit comments

Comments
 (0)