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