How to add HTML in forms label
- David Matějka
- Moderator | 6445
Hi, you can use Nette\Utils\Html
instance as a label:
$form->addCheckboxList('gdpr', Nette\Utils\Html::el('a')->href(...)->setText('GDPR'), ['gdpr' => 'I agree with GDPR'])->setRequired();
you can also use it as a label of individual checkbox list items.
(btw, are you sure you need Checkbox list? isn't basic checkbox
sufficient?)
more info in doc: https://doc.nette.org/…tml-elements