本文整理汇总了PHP中Helpers::selected方法的典型用法代码示例。如果您正苦于以下问题:PHP Helpers::selected方法的具体用法?PHP Helpers::selected怎么用?PHP Helpers::selected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helpers
的用法示例。
在下文中一共展示了Helpers::selected方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<div class="form-group">
<label for="inputPassword" class="col-lg-3 control-label">Пароль</label>
<div class="col-lg-9">
<input kl_virtual_keyboard_secure_input="on" class="form-control" id="inputPassword" placeholder="Пароль" type="password" name="password" value="" />
</div>
</div>
<div class="form-group">
<label for="formRole" class="col-lg-3 control-label">Роль</label>
<div class="col-lg-9">
<select class="form-control" id="formRole" name="role">
<option></option>';
if (!empty($userRoles) && is_array($userRoles)) {
foreach ($userRoles as $role => $title) {
echo '<option value="' . $role . '" ' . Helpers::selected(@$result['data']['form']['role'], $role) . '>' . $title . '</option>';
}
}
echo '
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<input type="hidden" name="action" value="1">
<button type="submit" class="btn btn-primary">Сохранить</button>
</div>
</div>
</fieldset>
示例2: foreach
<legend><?php
echo $tableHeader;
?>
</legend>
<table class="col-lg-12">
<tr>
<td class="col-lg-6" style="padding: 0;">
<div class="form-group">
<label for="formSurgeonId" class="col-lg-2 control-label">Хирург</label>
<div class="col-lg-10">
<select class="form-control" id="formSurgeonId" name="surgeonId">
<option></option>
<?php
foreach ($result['surgeonsList'] as $surgeon) {
echo '<option value="' . $surgeon['id'] . '" ' . Helpers::selected($surgeon['id'], $result['data']['form']['surgeonId']) . '>' . $surgeon['fio'] . '</option>';
}
?>
</select>
</div>
</div>
<div class="form-group">
<label for="inputNumber" class="col-lg-2 control-label">Номер</label>
<div class="col-lg-10">
<input kl_virtual_keyboard_secure_input="on" class="form-control" id="inputNumber" placeholder="Номер" type="text" name="number" value="<?php
echo @$result['data']['form']['number'];
?>
" />
</div>