本文整理汇总了PHP中Convert::selectOption方法的典型用法代码示例。如果您正苦于以下问题:PHP Convert::selectOption方法的具体用法?PHP Convert::selectOption怎么用?PHP Convert::selectOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Convert
的用法示例。
在下文中一共展示了Convert::selectOption方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
echo $error;
?>
<p>
<label class="label_text">Tên dịch vụ</label>
<input type="text" name="feature" class="input_text" value="<?php
echo $feature;
?>
"/>
</p>
<p>
<label class="label_text">Dịch vụ cha</label>
<select name="parent_id">
<option value="0">Dịch vụ mới</option>
<?php
echo Convert::selectOption($services, 'id', 'feature', $parent_id);
?>
</select>
</p>
<p>
<label class="label_text">Sắp xếp</label>
<select name="ordinal" class="">
<?php
if ($total > 0) {
for ($total; $total > 0; $total--) {
if ($ordinal == $total) {
echo '<option value="' . $total . '" selected="selected">' . $total . '</option>';
} else {
echo '<option value="' . $total . '">' . $total . '</option>';
}
}
示例2: exeAdd
public function exeAdd()
{
Document::setTitle('Viết bài mới');
Document::setJs(array('jquery-1.8.3.min', 'ckeditor/ckeditor', 'replace-content', 'article-add-edit'));
$data['action'] = BASE_URL_ADMIN . '/article/insert';
$data['error'] = '';
if (Session::get('article') != null) {
$data['error'] = '<p class="error">' . Session::get('error') . '</p>';
Session::unsetSession('error');
}
$data['pin'] = Session::get('article')['pin'];
$data['quote'] = Session::get('article')['quote'];
$data['title'] = Session::get('article')['title'];
$sv = $this->LoadService();
$service = $sv->selectAll();
if (Session::get('article')['services'] != null) {
$selected = Session::get('article')['services'];
} elseif (Request::get('service') != null) {
$selected = Request::get('service');
} else {
$selected = 0;
}
$data['services'] = Convert::selectOption($service, 'id', 'feature', $selected);
$data['content'] = Session::get('article')['content'];
Session::unsetSession('article');
$this->view->render('add', $data);
}