n:name latte notation for checkboxes

6 years ago

duke
Member | 646
+
0
-

In current dev-master following latte notation doesn't work for checkboxes:

<input n:name="remember" />

It simply generates mere “<input>”, which is caused by calling method Html::attributes(), which in this case returns an empty string (because the Html object contains a label-input pair rather than a single input).

It was probably introduced by this commit.

6 years ago

Milo
Nette Core | 1149
+
0
-

See issue 1331.

6 years ago

duke
Member | 646
+
0
-

So in other words, you are saying that I should use:

<input n:name="remember:" />

… which works.

However when I am using n:name notation, it should be obvious to latte, that I merely want to connect the manually written input tag with the form, so IMHO colon shouldn't be necessary here.

And it definitely shouldn't produce empty input tag.

6 years ago

David Grudl
Nette Core | 6850
+
0
-

This is a problem which I am aware. n:name should always use partial rendering. There are three solutions:

  • used method_exists(‘getControlPart’) in FormMacros.php (maybe quick workaround for 2.1.1)
  • add interface for partial rendering
  • add partial rendering directly to BaseControl

6 years ago

Patrik Votoček
Member | 2249
+
0
-

vote for interface