xref: /webtrees/resources/views/components/select-number.phtml (revision 1ff45046fabc22237b5d0d8e489c96f031fc598d)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6
7/**
8 * @var string|null   $class
9 * @var string|null   $id
10 * @var string        $name
11 * @var mixed         $selected
12 * @var array<string> $options
13 */
14
15?>
16
17<select
18    class="form-select <?= $class ?? '' ?>"
19    name="<?= e($name) ?>"
20    id="<?= e($id ?? $name) ?>"
21>
22    <?php foreach ($options as $n) : ?>
23        <option value="<?= (int) $n ?>" <?= (int) $n === (int) $selected ?  'selected' : '' ?>>
24            <?= I18N::number($n) ?>
25        </option>
26    <?php endforeach ?>
27</select>
28