xref: /webtrees/resources/views/components/checkbox.phtml (revision 0d047a8c74753c7558a60f4789c838996d6fae8b)
1<?php
2
3/**
4 * @var bool|null   $checked
5 * @var bool|null   $disabled
6 * @var string|null $id
7 * @var string      $label
8 * @var string      $name
9 * @var string      $value
10 */
11
12?>
13
14<div class="form-check">
15    <input type="checkbox" class="form-check-input"
16        name="<?= e($name) ?>"
17        id="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>"
18        value="<?= e($value ?? '1') ?>"
19        <?= $checked ?? false ? 'checked="checked"' : '' ?>
20        <?= $disabled ?? false ? 'disabled="disabled"' : '' ?>
21    />
22    <label class="form-check-label" for="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>">
23        <?= $label ?>
24    </label>
25</div>
26