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