@@ -41,7 +41,7 @@ public function __construct($label = NULL, array $items = NULL)
4141 $ this ->control ->type = 'checkbox ' ;
4242 $ this ->container = Html::el ();
4343 $ this ->separator = Html::el ('br ' );
44- // $this->itemLabel = Html::el('label'); back compatiblity
44+ $ this ->itemLabel = Html::el ('label ' );
4545 $ this ->setOption ('type ' , 'checkbox ' );
4646 }
4747
@@ -65,7 +65,7 @@ public function getControl(): Html
6565 'required ' => NULL ,
6666 'data-nette-rules: ' => [key ($ items ) => $ input ->attrs ['data-nette-rules ' ]],
6767 ]),
68- $ this ->itemLabel ? $ this -> itemLabel -> attrs : $ this -> label ->attrs ,
68+ $ this ->itemLabel ->attrs ,
6969 $ this ->separator
7070 )
7171 );
@@ -97,7 +97,7 @@ public function getControlPart($key = NULL): Html
9797
9898 public function getLabelPart ($ key = NULL ): Html
9999 {
100- $ itemLabel = $ this -> itemLabel ? clone $ this ->itemLabel : clone $ this -> label ;
100+ $ itemLabel = clone $ this ->itemLabel ;
101101 return func_num_args ()
102102 ? $ itemLabel ->setText ($ this ->translate ($ this ->items [$ key ]))->for ($ this ->getHtmlId () . '- ' . $ key )
103103 : $ this ->getLabel ();
@@ -127,7 +127,7 @@ public function getContainerPrototype(): Html
127127 */
128128 public function getItemLabelPrototype (): Html
129129 {
130- return $ this ->itemLabel ?: $ this -> itemLabel = Html:: el ( ' label ' ) ;
130+ return $ this ->itemLabel ;
131131 }
132132
133133}
0 commit comments