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