n:name latte notation for checkboxes

Notice: This thread is very old.
duke
Member | 650
+
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.

Milo
Nette Core | 1185
+
0
-

See issue 1331.

duke
Member | 650
+
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.

David Grudl
Nette Core | 7466
+
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
Patrik Votoček
Member | 2221
+
0
-

vote for interface