aboutsummaryrefslogtreecommitdiff
path: root/templates/datafields/radio.php
blob: ad0733035bc711bda9d7ec6aef04e5c96b9ece5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<label>
    <span class="datafield_title <?= $model->is_required ? 'required' : '' ?>">
        <?= htmlReady($model->name) ?>
    </span>

    <? if ($model->description): ?>
        <?= tooltipIcon($model->description) ?>
    <? endif ?>
</label>

<? foreach ($type_param as $pkey => $pval): ?>
    <label>
        <input type="radio" name="<?= $name ?>[<?= $model->id ?>]"
               value="<?= $is_assoc ? (string) $pkey : $pval ?>"
               <?= !$entry->isEditable() ? "disabled" : "" ?>
               <? if ($value === ($is_assoc ? (string)$pkey : $pval)) echo 'checked'; ?>
               <? if ($model->is_required) echo 'required'; ?>>
        <?= htmlReady($pval) ?>
    </label>
<? endforeach ?>