macro {input} cannot modify class

5 years ago

DOBss
Member | 24
+
0
-

In the latest version of nette (2.1.1) there is no way to change the class of a checkbox input in the template. I tried both the {input name class => active} and {input name, class => active} too, nothing changed. The only way in this version was to do it from the presenter while creating the component.

$items->addCheckbox('active')->getControlPrototype()->class('active');

Please have a look.

PS – there is no problem with text, hidden and select inputs.

5 years ago

David Grudl
Nette Core | 6850
+
0
-

Checkboxes in 2.1 require colons after name: {input name: class => active}

5 years ago

DOBss
Member | 24
+
0
-

So this was why they were rendered as <label><input /></label> ant not just the input itself using the {input} marcro. Thanks for your reply, I was just a litle bit lazy – it was in the release not I just noticed… thanks again!