xref: /webtrees/resources/views/components/select-number.phtml (revision 053cb27d4c02c576fc394f4df28726cfc5f6db78)
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