Skip to content

Commit 7bc0999

Browse files
committed
DefaultFormRenderer: automatically sets setOption('rendered', TRUE)
1 parent 5931ed1 commit 7bc0999

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

examples/custom-control.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public function loadHttpData()
6262
*/
6363
public function getControl()
6464
{
65-
$this->setOption('rendered', TRUE);
6665
$name = $this->getHtmlName();
6766
return Html::el()
6867
->add(Html::el('input')->name($name . '[day]')->id($this->getHtmlId())->value($this->day))

src/Forms/Rendering/DefaultFormRenderer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ public function renderPairMulti(array $controls)
385385
$description = '';
386386
}
387387

388+
$control->setOption('rendered', TRUE);
388389
$el = $control->getControl();
389390
if ($el instanceof Html && $el->getName() === 'input') {
390391
$el->class($this->getValue("control .$el->type"), TRUE);
@@ -444,6 +445,7 @@ public function renderControl(Nette\Forms\IControl $control)
444445
$description = $this->getValue('control requiredsuffix') . $description;
445446
}
446447

448+
$control->setOption('rendered', TRUE);
447449
$el = $control->getControl();
448450
if ($el instanceof Html && $el->getName() === 'input') {
449451
$el->class($this->getValue("control .$el->type"), TRUE);

0 commit comments

Comments
 (0)