本文整理汇总了PHP中html::select方法的典型用法代码示例。如果您正苦于以下问题:PHP html::select方法的具体用法?PHP html::select怎么用?PHP html::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类html
的用法示例。
在下文中一共展示了html::select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxGetGroupPrivsByMethod
public function ajaxGetGroupPrivsByMethod($module, $method)
{
$groupObjs = $this->kevinlogin->getGroupPrivsByMethod($module, $method);
$groupArray = array_keys($groupObjs);
$chosenGroupStr = implode(',', $groupArray);
die(html::select('groups[]', $this->loadModel('group')->getPairs(), $chosenGroupStr, "multiple='multiple' style='height:200px' class='form-control'"));
}
示例2: setMenu
/**
* Set the menu.
*
* @param array $users user pairs
* @param string $account current account
* @access public
* @return void
*/
public function setMenu($users, $account)
{
$methodName = $this->app->getMethodName();
$selectHtml = html::select('account', $users, $account, "onchange=\"switchAccount(this.value, '{$methodName}')\"");
foreach ($this->lang->user->menu as $key => $value) {
$replace = $key == 'account' ? $selectHtml : $account;
common::setMenuVars($this->lang->user->menu, $key, $replace);
}
}
示例3: ajaxGetBranches
public function ajaxGetBranches($productID)
{
$product = $this->loadModel('product')->getById($productID);
if (empty($product) or $product->type == 'normal') {
die;
}
$branches = $this->branch->getPairs($productID);
die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch()'"));
}
示例4: render
/**
* Render
*
* @param object $object
* @return string
*/
public static function render($object)
{
$input = $object->options['input'];
// generating form
$table = ['header' => ['column' => i18n(null, 'Column'), 'value' => i18n(null, 'Value')], 'options' => [], 'skip_header' => 1];
$model = new object_content_exports();
$table['options'][0]['column'] = ['value' => i18n(null, 'Format') . ':', 'width' => '1%', 'nowrap' => true, 'class' => 'list_filter_name'];
$table['options'][0]['value']['value'] = html::select(['id' => 'export_format', 'name' => 'export[format]', 'options' => $model->options(['i18n' => true]), 'value' => $input['export']['format'] ?? null]);
$body = html::table($table);
$footer = html::button2(['name' => 'submit_export', 'value' => i18n(null, 'Submit'), 'type' => 'primary', 'onclick' => "if (\$('#export_format').val() == 'html2') { \$('#list_{$object->list_link}_form').attr('target', '_blank'); } else { \$('#list_{$object->list_link}_form').attr('target', '_self'); } \$('#list_{$object->list_link}_form').attr('no_ajax', 1); numbers.modal.hide('list_{$object->list_link}_export'); return true;"]);
return html::modal(['id' => "list_{$object->list_link}_export", 'class' => '', 'title' => i18n(null, 'Export/Print'), 'body' => $body, 'footer' => $footer]);
}
示例5: setMenu
/**
* Set menus
*
* @param array $libs
* @param int $libID
* @param string $extra
* @access public
* @return void
*/
public function setMenu($libs, $libID, $extra = '')
{
$currentModule = $this->app->getModuleName();
$currentMethod = $this->app->getMethodName();
$selectHtml = html::select('libID', $libs, $libID, "onchange=\"switchDocLib(this.value, '{$currentModule}', '{$currentMethod}', '{$extra}');\"");
common::setMenuVars($this->lang->doc->menu, 'list', $selectHtml . $this->lang->arrow);
foreach ($this->lang->doc->menu as $key => $menu) {
if ($key != 'list') {
common::setMenuVars($this->lang->doc->menu, $key, $libID);
}
}
}
示例6: select
/**
* see html::select();
*/
public static function select($options = [])
{
// we do not process readonly selects
if (empty($options['readonly'])) {
// include js & css files
layout::add_js('/numbers/media_submodules/numbers_frontend_components_select_numbers_media_js_base.js', 10000);
layout::add_css('/numbers/media_submodules/numbers_frontend_components_select_numbers_media_css_base.css', 10000);
// font awesome icons
library::add('fontawesome');
// id with name
if (empty($options['id']) && !empty($options['name'])) {
$options['id'] = $options['name'];
}
layout::onload('numbers_select(' . json_encode(['id' => $options['id']]) . ');');
}
// must gain proper class from previous submodule
$options['flag_call_previous_parent'] = true;
return html::select($options);
}
示例7: render
/**
* Render
*
* @param object $object
* @return string
*/
public static function render($object)
{
$input = $object->options['input'];
if (empty($input['sort'])) {
$i = 0;
foreach ($object->orderby as $k => $v) {
$input['sort'][$i]['column'] = $k;
$input['sort'][$i]['order'] = $v;
$i++;
}
}
// generating form
$table = ['header' => ['row_number' => ' ', 'column' => i18n(null, 'Column'), 'order' => i18n(null, 'Order')], 'options' => []];
$order_model = new object_data_model_order();
$columns = [];
// we need to skip certain columns
foreach ($object->columns as $k => $v) {
if (!in_array($k, ['row_number', 'offset_number', 'action'])) {
$v['name'] = i18n(null, $v['name']);
$columns[$k] = $v;
}
}
// full text search goes last
if (!empty($object->filter['full_text_search'])) {
$columns['full_text_search'] = ['name' => i18n(null, 'Text Search')];
}
// render 5 rows
for ($i = 0; $i < 5; $i++) {
if (empty($input['sort'][$i]['column'])) {
$input['sort'][$i]['order'] = SORT_ASC;
}
$column = html::select(['id' => 'sort_' . $i . '_column', 'name' => 'sort[' . $i . '][column]', 'options' => $columns, 'value' => $input['sort'][$i]['column'] ?? null]);
$order = html::select(['id' => 'sort_' . $i . '_order', 'name' => 'sort[' . $i . '][order]', 'no_choose' => true, 'options' => $order_model->options(['i18n' => true]), 'value' => $input['sort'][$i]['order'] ?? null]);
$table['options'][$i] = ['row_number' => ['value' => format::id($i + 1) . '.', 'width' => '1%', 'align' => 'right'], 'column' => ['value' => $column, 'width' => '25%', 'class' => 'list_sort_name'], 'order' => ['value' => $order, 'width' => '30%']];
}
$body = html::table($table);
$footer = html::button2(['name' => 'submit_sort', 'value' => i18n(null, 'Submit'), 'type' => 'primary', 'onclick' => "numbers.modal.hide('list_{$object->list_link}_sort'); \$('#list_{$object->list_link}_form').attr('target', '_self'); \$('#list_{$object->list_link}_form').attr('no_ajax', ''); return true;"]);
return html::modal(['id' => "list_{$object->list_link}_sort", 'class' => 'large', 'title' => i18n(null, 'Sort'), 'body' => $body, 'footer' => $footer]);
}
示例8: isset
<th><?php
echo $lang->block->showCategory;
?>
</th>
<td>
<div class='input-group'>
<span class='input-group-addon'>
<input type='checkbox' name='params[showCategory]' <?php
if (isset($block->content->showCategory) && $block->content->showCategory) {
echo 'checked';
}
?>
value='1' />
</span>
<?php
echo html::select('params[categoryName]', $lang->block->category->showCategoryList, isset($block->content->categoryName) ? $block->content->categoryName : '', "class='form-control'");
?>
</div>
</td>
</tr>
<tr>
<th><?php
echo $lang->block->showImage;
?>
</th>
<td><input type='checkbox' name='params[image]' <?php
if (isset($block->content->image) && $block->content->image) {
echo 'checked';
}
?>
value='1' /></td>
示例9: array_keys
<th class='w-100px'><?php
echo $lang->product->category;
?>
</th>
<td class='w-p40'><?php
echo html::select("categories[]", $categories, array_keys($product->categories), "multiple='multiple' class='form-control chosen'");
?>
</td><td></td>
</tr>
<tr>
<th><?php
echo $lang->product->status;
?>
</th>
<td><?php
echo html::select("status", $lang->product->statusList, $product->status, "class='form-control'");
?>
</td>
</tr>
<tr>
<th><?php
echo $lang->product->name;
?>
</th>
<td colspan='2'>
<div class='row order'>
<div class='col-sm-10'><?php
echo html::input('name', $product->name, "class='form-control'");
?>
</div>
<div class='col-sm-2'>
示例10: inlink
?>
<form method='post' action='<?php
echo inlink('confirm');
?>
'>
<div class='container'>
<div class='modal-dialog'>
<div class='modal-header'>
<h3><?php
echo $lang->upgrade->selectVersion;
?>
</h3>
</div>
<div class='modal-body'>
<div class='form-group'>
<?php
echo html::select('fromVersion', $lang->upgrade->fromVersions, $version, "class='form-control single-input'");
echo " <span class='text-danger help-inline'>{$lang->upgrade->versionNote}</span>";
?>
</div>
</div>
<div class='modal-footer'>
<?php
echo html::submitButton($lang->upgrade->common);
?>
</div>
</div>
</div>
</form>
<?php
include '../../install/view/footer.html.php';
示例11: printf
echo html::input('name', $this->config->site->name, "class='form-control'");
?>
</td><td></td>
</tr>
<tr>
<th>
<?php
echo $lang->ui->logo;
?>
</th>
<td><?php
echo html::file('files', "class='form-control'");
?>
</td>
<td><?php
echo html::select('theme', $lang->ui->logoList, '', "class='form-control'");
?>
</td>
</tr>
<tr>
<td></td>
<td colspan='2'>
<strong class='text-info'>
<?php
if ($this->device == 'desktop') {
printf($lang->ui->suitableLogoSize, '50px-80px', '80px-240px');
}
?>
<?php
if ($this->device == 'mobile') {
printf($lang->ui->suitableLogoSize, '<50px', '50px-200px');
示例12:
if (isset($config->block->defaultIcons[$type])) {
?>
<?php
if (!isset($block->content->icon)) {
$block->content->icon = $config->block->defaultIcons[$type];
}
?>
<tr>
<th><?php
echo $lang->block->icon;
?>
</th>
<td>
<div class='row'>
<div class='col-sm-6'><?php
echo html::select('params[icon]', '', '', "class='chosen-icons' data-value='{$block->content->icon}'");
?>
</div>
<div class='col-sm-6'>
</div>
</div>
</td>
</tr>
<?php
}
?>
<?php
echo $this->fetch('block', 'blockForm', 'type=' . $type . '&id=' . $block->id);
?>
<?php
if (isset($config->block->defaultMoreUrl[$block->type])) {
示例13: inlink
echo inlink('edit', 'categoryID=' . $category->id);
?>
">
<div class='panel'>
<div class='panel-heading'><strong><i class="icon-pencil"></i> <?php
echo $lang->tree->edit;
?>
</strong></div>
<div class='panel-body'>
<div class='form-group'>
<label class='col-md-2 control-label'><?php
echo $lang->category->parent;
?>
</label>
<div class='col-md-4'><?php
echo html::select('parent', $optionMenu, $category->parent, "class='chosen form-control'");
?>
</div>
</div>
<div class='form-group'>
<label class='col-md-2 control-label'><?php
echo $lang->category->name;
?>
</label>
<div class='col-md-9 required'>
<div class="input-group">
<?php
echo html::input('name', $category->name, "class='form-control'");
?>
<?php
if ($category->type != 'forum' or $category->parent != 0) {
示例14: isset
echo $lang->site->mobileTemplate;
?>
</th>
<td><?php
echo html::radio('mobileTemplate', $lang->site->mobileTemplateList, isset($this->config->site->mobileTemplate) ? $this->config->site->mobileTemplate : 'close', "class='checkbox'");
?>
</td><td></td>
</tr>
<tr>
<th><?php
echo $lang->site->requestType;
?>
</th>
<td>
<?php
echo html::select('requestType', $lang->site->requestTypeList, isset($this->config->site->requestType) ? $this->config->site->requestType : $this->config->frontRequestType, "class='form-control'");
?>
</td>
<td><span id='requestTypeTip' class='hide text-important'><?php
echo $lang->site->requestTypeTip;
?>
</span></td>
</tr>
<tr>
<th><?php
echo $lang->site->name;
?>
</th>
<td><?php
echo html::input('name', $this->config->site->name, "class='form-control'");
?>
示例15:
if ($story->closedReason != 'subdivided') {
echo "style='display:none'";
}
?>
>
<?php
echo html::input("childStoriesIDList[{$story->id}]", '', "class=w-30px placeholder='{$lang->idAB}'");
?>
</div>
</td>
<?php
} else {
?>
<td class='f-left'><?php
echo html::select("closedReasons[{$story->id}]", $lang->story->reasonList, $story->closedReason, 'class="w-60px" disabled="disabled"');
?>
</td>
<?php
}
?>
<td><?php
echo html::textarea("comments[{$story->id}]", '', "rows='2' class='area-1'");
?>
</td>
</tr>
<?php
}
?>
<?php