Skip to content

Commit

Permalink
DefaultFormRenderer, FormsLatte: hidden fields are marked via option …
Browse files Browse the repository at this point in the history
…'hidden' instead of class type HiddenField
  • Loading branch information
dg committed Jan 11, 2016
1 parent ffb3b6b commit 728c43e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Bridges/FormsLatte/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public static function renderFormEnd(Form $form, $withTags = TRUE)
}
}

foreach ($form->getComponents(TRUE, Nette\Forms\Controls\HiddenField::class) as $control) {
if (!$control->getOption('rendered')) {
foreach ($form->getControls() as $control) {
if ($control->getOption('type') === 'hidden' && !$control->getOption('rendered')) {
$s .= $control->getControl();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Forms/Rendering/DefaultFormRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public function renderEnd()
{
$s = '';
foreach ($this->form->getControls() as $control) {
if ($control instanceof Nette\Forms\Controls\HiddenField && !$control->getOption('rendered')) {
if ($control->getOption('type') === 'hidden' && !$control->getOption('rendered')) {
$s .= $control->getControl();
}
}
Expand Down Expand Up @@ -312,7 +312,7 @@ public function renderControls($parent)

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

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

0 comments on commit 728c43e

Please sign in to comment.