xref: /webtrees/resources/views/components/select-place.phtml (revision 1baf69dec287f195fbbefc3bae3c0b33957a89c3)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\AbstractTomSelectHandler;
4use Fisharebest\Webtrees\Http\RequestHandlers\TomSelectPlace;
5use Fisharebest\Webtrees\Place;
6use Fisharebest\Webtrees\Tree;
7
8/**
9 * @var Place|null  $place
10 * @var string|null $class
11 * @var string|null $id
12 * @var string      $name
13 * @var Tree        $tree
14 */
15
16?>
17
18<select
19    autocomplete="off"
20    class="form-select tom-select <?= $class ?? '' ?>"
21    data-url="<?= e(route(TomSelectPlace::class, ['tree' => $tree->name()])) ?>"
22    id="<?= e($id ?? $name) ?>"
23    name="<?= e($name) ?>"
24    <?= ($disabled ?? false) ? 'disabled="disabled"' : '' ?>
25    <?= ($required ?? false) ? 'required="required"' : '' ?>
26>
27    <?php if (($place ?? null) instanceof Place) : ?>
28        <option value="<?= e($place->id()) ?>">
29            <?= view('selects/place', ['place' => $place]) ?>
30        </option>
31    <?php else : ?>
32        <option value="">&nbsp;</option>
33    <?php endif ?>
34</select>
35