fisharebest/webtrees

View on GitHub
resources/views/components/radio.phtml

Summary

Maintainability
Test Coverage
<?php

declare(strict_types=1);

/**
 * @var bool|null   $checked
 * @var bool|null   $disabled
 * @var string|null $id
 * @var string      $label
 * @var string      $name
 * @var string      $value
 */

?>

<div class="form-check">
    <input type="radio" class="form-check-input"
        name="<?= e($name) ?>"
        id="<?= e($id ?? $name . '-' . $value) ?>"
        value="<?= e($value) ?>"
        <?= $checked ?? false ? 'checked="checked"' : '' ?>
        <?= $disabled ?? false ? 'disabled="disabled"' : '' ?>
       required="required"
    />
    <label class="form-check-label" for="<?= e($id ?? $name . '-' . $value) ?>">
        <?= $label ?>
    </label>
</div>