public static function makeCheckbox(
		$name, $htmlId, $caption = NULL, $checked = FALSE, $value = FALSE, $required = FALSE,
		$disabled = FALSE, $rules = NULL)
	{
		$label = Html::el('label', ['class' => ['custom-control', 'custom-checkbox']]);
		$input = Html::el('input', [
			'type'             => 'checkbox',
			'class'            => ['custom-control-input'],
			'name'             => $name,
			'disabled'         => $disabled,
			'required'         => $required,
			'checked'          => $checked,
			'id'               => $htmlId,
			'data-nette-rules' => $rules ? Nette\Forms\Helpers::exportRules($rules) : FALSE,
		]);
		if ($value !== FALSE) {
			$input->attrs += [
				'value' => $value,
			];
		}

		$label->addHtml($input);
		$label->addHtml(
			Html::el('label', [
				'class' => ['custom-control-label'],
				'for'   => $htmlId,
			])->setText($caption)
		);

		$line = Html::el('div');
		$line->addHtml($label);

		return $label;
	}
public static function makeCheckbox(
		$name, $htmlId, $caption = NULL, $checked = FALSE, $value = FALSE, $required = FALSE,
		$disabled = FALSE, $rules = NULL)
	{
		$label = Html::el('label', ['class' => ['custom-control', 'custom-checkbox']]);
		$input = Html::el('input', [
			'type'             => 'checkbox',
			'class'            => ['custom-control-input'],
			'name'             => $name,
			'disabled'         => $disabled,
			'required'         => $required,
			'checked'          => $checked,
			'id'               => $htmlId,
			'data-nette-rules' => $rules ? Nette\Forms\Helpers::exportRules($rules) : FALSE,
		]);
		if ($value !== FALSE) {
			$input->attrs += [
				'value' => $value,
			];
		}

		$label->addHtml($input);
		$label->addHtml(
			Html::el('label', [
				'class' => ['custom-control-label'],
				'for'   => $htmlId,
			])->setText($caption)
		);

		$line = Html::el('div');
		$line->addHtml($label);

		return $label;
	}
public static function makeCheckbox ( $ name , $ htmlId , $ caption = NULL , $ checked = FALSE , $ value = FALSE , $ required = FALSE , $ disabled = FALSE , $ rules = NULL ) { $ label = Html :: el ( 'label' , [ 'class' => [ 'custom-control' , 'custom-checkbox' ] ] ) ; $ input = Html :: el ( 'input' , [ 'type' => 'checkbox' , 'class' => [ 'custom-control-input' ] , 'name' => $ name , 'disabled' => $ disabled , 'required' => $ required , 'checked' => $ checked , 'id' => $ htmlId , 'data-nette-rules' => $ rules ? Nette \ Forms \ Helpers :: exportRules ( $ rules ) : FALSE , ] ) ; if ( $ value !== FALSE ) { $ input -> attrs += [ 'value' => $ value , ] ; } $ label -> addHtml ( $ input ) ; $ label -> addHtml ( Html :: el ( 'label' , [ 'class' => [ 'custom-control-label' ] , 'for' => $ htmlId , ] ) -> setText ( $ caption ) ) ; $ line = Html :: el ( 'div' ) ; $ line -> addHtml ( $ label ) ; return $ label ; }
Makes a Bootstrap checkbox HTML
@param string                 $name
@param string                 $htmlId
@param string|null            $caption
@param bool                   $checked
@param bool|mixed             $value pass false to omit
@param bool                   $required
@param bool                   $disabled
@param Nette\Forms\Rules|null $rules
@return Html
Makes a Bootstrap checkbox HTML