xref: /webtrees/resources/views/components/select-number.phtml (revision dec352c1d7404cdd35c9b1a1b5d97f29e7c4ebb5)
1<?php
2
3/**
4 * @var string|null $class
5 * @var string|null $id
6 * @var string      $name
7 * @var mixed       $selected
8 * @var string[]    $options
9 */
10
11use Fisharebest\Webtrees\I18N;
12
13?>
14
15<select
16    class="form-control <?= $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