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