@@ -41,7 +41,7 @@ public function __construct($label = NULL, array $items = NULL)
41
41
$ this ->control ->type = 'checkbox ' ;
42
42
$ this ->container = Html::el ();
43
43
$ this ->separator = Html::el ('br ' );
44
- // $this->itemLabel = Html::el('label'); back compatiblity
44
+ $ this ->itemLabel = Html::el ('label ' );
45
45
$ this ->setOption ('type ' , 'checkbox ' );
46
46
}
47
47
@@ -65,7 +65,7 @@ public function getControl(): Html
65
65
'required ' => NULL ,
66
66
'data-nette-rules: ' => [key ($ items ) => $ input ->attrs ['data-nette-rules ' ]],
67
67
]),
68
- $ this ->itemLabel ? $ this -> itemLabel -> attrs : $ this -> label ->attrs ,
68
+ $ this ->itemLabel ->attrs ,
69
69
$ this ->separator
70
70
)
71
71
);
@@ -97,7 +97,7 @@ public function getControlPart($key = NULL): Html
97
97
98
98
public function getLabelPart ($ key = NULL ): Html
99
99
{
100
- $ itemLabel = $ this -> itemLabel ? clone $ this ->itemLabel : clone $ this -> label ;
100
+ $ itemLabel = clone $ this ->itemLabel ;
101
101
return func_num_args ()
102
102
? $ itemLabel ->setText ($ this ->translate ($ this ->items [$ key ]))->for ($ this ->getHtmlId () . '- ' . $ key )
103
103
: $ this ->getLabel ();
@@ -127,7 +127,7 @@ public function getContainerPrototype(): Html
127
127
*/
128
128
public function getItemLabelPrototype (): Html
129
129
{
130
- return $ this ->itemLabel ?: $ this -> itemLabel = Html:: el ( ' label ' ) ;
130
+ return $ this ->itemLabel ;
131
131
}
132
132
133
133
}
0 commit comments