-
Notifications
You must be signed in to change notification settings - Fork 988
/
buttongroup.php
27 lines (27 loc) · 1.21 KB
/
buttongroup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<div class="btn-group col-12" role="group" data-toggle="buttons"
aria-labelledby="label-<?= CHtml::getIdByName($this->generalOption->name); ?>"
<?= ($this->generalOption->formElement->help) ? 'aria-describedby="help-' . CHtml::getIdByName($this->generalOption->name) . '"' : "" ?>
>
<?php foreach ($this->generalOption->formElement->options['options'] as $i => $option): ?>
<?php if ($this->generalOption->formElement->value == $option->value) : ?>
<label class="btn btn-default active">
<input
type="radio"
name="question[<?= $this->generalOption->name; ?>]"
value="<?= Chtml::encode($option->value); ?>"
checked="checked"
/>
<?= $option->text; ?>
</label>
<?php else : ?>
<label class="btn btn-default">
<input
type="radio"
name="question[<?= $this->generalOption->name; ?>]"
value="<?= Chtml::encode($option->value); ?>"
/>
<?= $option->text; ?>
</label>
<?php endif; ?>
<?php endforeach; ?>
</div>