xref: /webtrees/resources/views/components/radio.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1b6c326d8SGreg Roach<?php
2b6c326d8SGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5b6c326d8SGreg Roach/**
6b6c326d8SGreg Roach * @var bool|null   $checked
7b6c326d8SGreg Roach * @var bool|null   $disabled
8b6c326d8SGreg Roach * @var string|null $id
9b6c326d8SGreg Roach * @var string      $label
10b6c326d8SGreg Roach * @var string      $name
11b6c326d8SGreg Roach * @var string      $value
12b6c326d8SGreg Roach */
13b6c326d8SGreg Roach
14b6c326d8SGreg Roach?>
15b6c326d8SGreg Roach
16dd6b2bfcSGreg Roach<div class="form-check">
17b6c326d8SGreg Roach    <input type="radio" class="form-check-input"
18b6c326d8SGreg Roach        name="<?= e($name) ?>"
19b6c326d8SGreg Roach        id="<?= e($id ?? $name . '-' . $value) ?>"
20b6c326d8SGreg Roach        value="<?= e($value) ?>"
214a213054SGreg Roach        <?= $checked ?? false ? 'checked="checked"' : '' ?>
224a213054SGreg Roach        <?= $disabled ?? false ? 'disabled="disabled"' : '' ?>
234a213054SGreg Roach       required="required"
244a213054SGreg Roach    />
25b6c326d8SGreg Roach    <label class="form-check-label" for="<?= e($id ?? $name . '-' . $value) ?>">
26b6c326d8SGreg Roach        <?= $label ?>
27dd6b2bfcSGreg Roach    </label>
28dd6b2bfcSGreg Roach</div>
29