@@ -42,7 +42,7 @@ public function __construct($label = NULL, array $items = NULL)
4242 $ this ->control ->type = 'checkbox ' ;
4343 $ this ->container = Html::el ();
4444 $ this ->separator = Html::el ('br ' );
45- // $this->itemLabel = Html::el('label'); back compatiblity
45+ $ this ->itemLabel = Html::el ('label ' );
4646 $ this ->setOption ('type ' , 'checkbox ' );
4747 }
4848
@@ -67,7 +67,7 @@ public function getControl()
6767 'required ' => NULL ,
6868 'data-nette-rules: ' => [key ($ items ) => $ input ->attrs ['data-nette-rules ' ]],
6969 ]),
70- $ this ->itemLabel ? $ this -> itemLabel -> attrs : $ this -> label ->attrs ,
70+ $ this ->itemLabel ->attrs ,
7171 $ this ->separator
7272 )
7373 );
@@ -106,7 +106,7 @@ public function getControlPart($key = NULL)
106106 */
107107 public function getLabelPart ($ key = NULL )
108108 {
109- $ itemLabel = $ this -> itemLabel ? clone $ this ->itemLabel : clone $ this -> label ;
109+ $ itemLabel = clone $ this ->itemLabel ;
110110 return func_num_args ()
111111 ? $ itemLabel ->setText ($ this ->translate ($ this ->items [$ key ]))->for ($ this ->getHtmlId () . '- ' . $ key )
112112 : $ this ->getLabel ();
@@ -139,7 +139,7 @@ public function getContainerPrototype()
139139 */
140140 public function getItemLabelPrototype ()
141141 {
142- return $ this ->itemLabel ?: $ this -> itemLabel = Html:: el ( ' label ' ) ;
142+ return $ this ->itemLabel ;
143143 }
144144
145145}
0 commit comments