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