php-censor/src/B8Framework/Form/View/Select.phtml
2017-01-14 16:12:53 +07:00

19 lines
738 B
PHTML

<div class="control-group <?php print $ccss; ?>">
<?php if ($label): ?>
<label class="control-label" for="<?php print $id ?>"><?php print $label; ?></label>
<?php endif; ?>
<div class="controls">
<select id="<?php print $id; ?>" class="<?php print $css; ?>" name="<?php print $name; ?>">
<?php foreach ($options as $val => $lbl): ?>
<option
value="<?php print $val; ?>" <?php print ($value == $val) ? ' selected="selected"' : ''; ?>><?php print $lbl; ?></option>
<?php endforeach; ?>
</select>
<?php if (isset($error)): ?>
<span class="help-block"><?php print $error; ?></span>
<?php endif; ?>
</div>
</div>