macro formPrint throws exception if getControlPart is called
MartkCz opened this issue · comments
Version: 3.0.6
I've following checkbox:
$form->addCheckbox('checkbox');
and simple template:
<div class="col-sm-10 col-sm-offset-2">
<div class="checkbox">
<label for="{$val->getHtmlId()}">
{$val->getControlPart()} {$val->caption}
</label>
</div>
{include controlErrors $val}
</div>
throws exception: Return value of Nette\Forms\Controls\BaseControl::getControlPart() must be an instance of Nette\Utils\Html or null, string returned
because of https://github.com/nette/forms/blob/master/src/Bridges/FormsLatte/Runtime.php#L97
possible solution:
return \Nette\Utils\Html::fromText('{input ' . $this->inner->lookupPath(Form::class) . '}');
I don't get it at all. How are formPrint and the template related?