本文整理汇总了PHP中kartik\widgets\Select2::classname方法的典型用法代码示例。如果您正苦于以下问题:PHP Select2::classname方法的具体用法?PHP Select2::classname怎么用?PHP Select2::classname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\widgets\Select2
的用法示例。
在下文中一共展示了Select2::classname方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<!-- --><?php
//echo $form->field($model, 'id')
?>
<!-- --><?php
//echo $form->field($model, 'home_id')
?>
<!-- --><?php
//echo $form->field($model, 'guest_id')
?>
<div class="row">
<div class="col-xs-4">
<?php
echo $form->field($model, 'season_id')->widget(Select2::classname(), ['data' => ArrayHelper::map($model->getAllSeasons(), 'id', 'name'), 'options' => ['placeholder' => 'Выберите сезон ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
</div>
<div class="col-xs-4">
<?php
echo $form->field($model, 'category_id')->widget(Select2::className(), ['data' => ArrayHelper::map($model->getAllCategories(), 'id', 'name'), 'options' => ['placeholder' => 'Выберите категорию ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
</div>
<div class="col-xs-4">
<div class="form-group" style="margin-top: 25px">
<?php
echo Html::submitButton('Поиск', ['class' => 'btn btn-primary']);
?>
<!-- --><?php
//echo Html::resetButton('Сбросить', ['class' => 'btn btn-default'])
?>
示例2:
?>
<?php
echo $form->field($model, 'cargaHoraria')->textInput(['type' => 'number']);
?>
<?php
echo $form->field($model, 'palestrante_idPalestrante')->widget(Select2::classname(), ['data' => $arrayPalestrante, 'options' => ['placeholder' => 'Selecione um palestrante ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<p><?php
echo Html::a('Novo Palestrante', ['palestrante/index'], ['class' => 'btn btn-primary']);
?>
<p>
<?php
echo $form->field($model, 'local_idlocal')->widget(Select2::classname(), ['data' => $arrayLocal, 'options' => ['placeholder' => 'Selecione um Local ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<p><?php
echo Html::a('Novo Local', ['local/index'], ['class' => 'btn btn-primary']);
?>
<p>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? 'Criar Item de Programação' : 'Salvar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
示例3:
<?php
use yii\helpers\Html;
use kartik\widgets\ActiveForm;
use kartik\builder\Form;
use kartik\datecontrol\DateControl;
use kartik\widgets\Select2;
/**
* @var yii\web\View $this
* @var common\models\empresa\Osconfemp $model
* @var yii\widgets\ActiveForm $form
*/
?>
<div class="osconfemp-form">
<?php
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL]);
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 1, 'attributes' => ['coe_nombre' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\yii\\widgets\\MaskedInput', 'options' => ['mask' => 'A{3,10}9{0,5}']], 'coe_descri' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Enter Descripción...', 'maxlength' => 60]], 'coe_tipo' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => Select2::classname(), 'options' => ['data' => Yii::$app->orcsis->getOpcTab($model->tableName(), 'coe_tipo'), 'options' => ['placeholder' => 'Enter Tipo de Dato...']]], 'coe_data' => ['type' => Form::INPUT_TEXTAREA, 'options' => ['placeholder' => 'Enter Coe Data...', 'rows' => 6]]]]);
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
ActiveForm::end();
?>
</div>
示例4: JsExpression
$form->field($model, 'idcliente')->widget(Select2::classname(), [
'pluginOptions' => [
'allowClear' => true,
'minimumInputLength' => 2,
'ajax' => [
'url' => $url_cliente,
'dataType' => 'json',
'data' => new JsExpression('function(params) { return {search:params.term};}')
],
],
'options' => ['placeholder' => 'Selecione um cliente...'],
]) ?>
</div>
<div class="col-md-4"><?= $form->field($model, 'valor')->widget(MaskMoney::classname()) ?></div>
<?=
$form->field($model, 'forma_pagamento_id')->widget(Select2::classname(), [
'pluginOptions' => [
'allowClear' => true,
'minimumInputLength' => 2,
'ajax' => [
'url' => $url_forma_pagamento,
'dataType' => 'json',
'data' => new JsExpression('function(params) { return {search:params.term};}')
],
],
'options' => ['placeholder' => 'Selecione um cliente...'],
]) ?>
</div>
<div class="row">
<div class="col-md-4"><?= $form->field($model, 'data_vencimento')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'options' => ['pluginOptions' => ['autoclose' => true]]]) ?></div>
<div class="col-md-4"><?= $form->field($model, 'data_pagamento')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'options' => ['pluginOptions' => ['autoclose' => true]]]) ?></div>
示例5: date
?>
<?php
//= $form->errorSummary($model);
?>
<?php
echo $form->field($roDetail, 'CREATED_AT', ['template' => "{input}"])->hiddenInput(['value' => date('Y-m-d H:i:s'), 'readonly' => true]);
?>
<?php
echo $form->field($roDetail, 'KD_CORP')->dropDownList($userCorp, ['id' => 'rodetail-kd_corp', 'prompt' => ' -- Pilih Salah Satu --'])->label('Perusahaan');
echo $form->field($roDetail, 'KD_TYPE')->widget(DepDrop::classname(), ['type' => DepDrop::TYPE_SELECT2, 'data' => $brgType, 'options' => ['id' => 'rodetail-kd_type'], 'pluginOptions' => ['depends' => ['rodetail-kd_corp'], 'url' => Url::to(['/purchasing/sales-order/corp-type']), 'initialize' => true]])->label('Type');
echo $form->field($roDetail, 'KD_KATEGORI')->widget(DepDrop::classname(), ['type' => DepDrop::TYPE_SELECT2, 'data' => $brgKtg, 'options' => ['id' => 'rodetail-kd_kategori'], 'pluginOptions' => ['depends' => ['rodetail-kd_corp', 'rodetail-kd_type'], 'url' => Url::to(['/purchasing/sales-order/type-kat']), 'initialize' => true]]);
echo $form->field($roDetail, 'KD_BARANG')->widget(DepDrop::classname(), ['type' => DepDrop::TYPE_SELECT2, 'data' => $brgProdak, 'options' => ['id' => 'rodetail-kd_barang'], 'pluginOptions' => ['depends' => ['rodetail-kd_kategori'], 'url' => Url::to(['/purchasing/sales-order/brgkat']), 'initialize' => true]]);
echo $form->field($roDetail, 'NM_BARANG')->hiddenInput(['value' => ''])->label(false);
echo $form->field($roDetail, 'UNIT')->widget(Select2::classname(), ['data' => $brgUnit, 'options' => ['placeholder' => 'Pilih Unit Barang ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<?php
echo $form->field($roDetail, 'RQTY')->textInput(['maxlength' => true, 'placeholder' => 'Jumlah Barang']);
?>
<?php
echo $form->field($roDetail, 'NOTE')->textarea(array('rows' => 2, 'cols' => 5))->label('Informasi');
?>
<div class="form-group">
<?php
echo Html::submitButton($roDetail->isNewRecord ? 'Create' : 'Update', ['class' => $roDetail->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
示例6:
use yii\helpers\Html;
use kartik\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use lukisongroup\master\models\Nmperusahaan;
$addressCorp = ArrayHelper::map(Nmperusahaan::find()->orderBy('NM_ALAMAT')->all(), 'ID', 'NM_ALAMAT');
?>
<?php
$form = ActiveForm::begin(['id' => 'frm-bil-proccess', 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'method' => 'post', 'action' => ['/purchasing/purchase-order/billing-save']]);
?>
<?php
//echo $form->field($poHeaderVal, 'bILLING')->textInput()->label('Billing');
echo $form->field($poHeaderVal, 'bILLING')->widget(Select2::classname(), ['data' => $addressCorp, 'options' => ['placeholder' => 'Select Address for Billing ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<?php
echo $form->field($poHeaderVal, 'kD_PO')->hiddenInput(['value' => $poHeader->KD_PO, 'maxlength' => true, 'readonly' => true])->label(false);
?>
<div style="text-align: right;"">
<?php
echo Html::submitButton('simpan', ['class' => 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
示例7:
\$('#mod_entity_type_add').on('click',opencentitytypemod);
MODALJS;
$this->registerJs($modalJS);
?>
<div class="entity-form">
<?php
$form = ActiveForm::begin(['id' => 'EntityCreateForm', 'action' => Url::to(['/entity/default/create'])]);
?>
<div class="row">
<div class="col-md-12">
<?php
echo $form->field($model, 'entity_type_id')->widget(Select2::classname(), ['data' => EntityType::pdEntityType(), 'options' => ['placeholder' => 'Entity Type...'], 'addon' => ['prepend' => ['content' => Html::icon('globe')], 'append' => ['content' => Html::button(Html::icon('plus'), ['class' => 'btn btn-default', 'id' => 'mod_entity_type_add', 'title' => 'add new entity', 'data-toggle' => 'tooltip', 'href' => Url::to(['/entity/entity-type/create'])]), 'asButton' => true]], 'pluginOptions' => ['allowClear' => true]]);
?>
</div>
</div>
<div class="row">
<div class="col-md-6">
<?php
echo $form->field($model, 'prename')->textInput(['maxlength' => 100]);
?>
</div>
<div class="col-md-6">
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => 140]);
?>
</div>
示例8:
<?php
$form = Adm::begin('ActiveForm');
?>
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-4 readonly-cont">
<?php
echo $form->field($model, 'host')->textInput(['maxlength' => 250]);
?>
<?php
echo $form->field($model, 'port')->textInput(['maxlength' => 50]);
?>
<?php
echo $form->field($model, 'encryption')->widget(\kartik\widgets\Select2::classname(), ['data' => $model::encryptionList()]);
?>
</div>
<div class="col-xs-12 col-sm-4 col-md-4">
<?php
echo $form->field($model, 'from_email')->textInput(['maxlength' => 250]);
?>
<?php
echo $form->field($model, 'from_name')->textInput(['maxlength' => 250]);
?>
<div class="m-b-lg">
<label class="control-label"><?php
echo Adm::t('adm_email_config', 'Send copy to:', ['dot' => true]);
示例9:
echo $form->field($model, 'status')->widget(SwitchInput::classname(), ['type' => SwitchInput::CHECKBOX]);
?>
</div>
</div>
<?php
echo $form->field($model, 'description')->textArea(['maxlength' => 155, 'placeholder' => Yii::t('app', 'This description also used as meta description')]);
?>
</div>
<div class="col-md-6 well">
<?php
echo $form->field($model, 'parent_id')->widget(Select2::classname(), ['model' => $model, 'attribute' => 'parent_id', 'data' => $listParent, 'options' => ['placeholder' => Yii::t('app', 'Select a account parent...')], 'pluginOptions' => ['allowClear' => true], 'pluginEvents' => ["change" => 'function() {
}']]);
?>
<?php
if ($module->enableUpload) {
echo $form->field($model, 'image')->widget(KCFinderInputWidget::className(), ['multiple' => false, 'kcfOptions' => $kcfOptions, 'kcfBrowseOptions' => ['type' => 'images']]);
} else {
echo $form->field($model, 'image')->textInput(['placeholder' => Yii::t('app', 'Url of image')]);
}
?>
</div>
</div>
示例10: JsExpression
}
var markup =
'<div class="row">' +
'<div class="col-sm-1">' + image + '</div>'+
'<div class="col-sm-3"><b style="margin-left:5px">' + repo.brand_name + '</b></div>' +
'<div class="col-sm-3">SN:' + repo.brand_store_sn + '</div>' +
'</div>';
return '<div style="overflow:hidden;">' + markup + '</div>';
};
JS;
$this->registerJs($formatJs, View::POS_HEAD);
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
<div class="brand-form box-body">
<?php
echo $form->field($model, 'sn')->widget(\kartik\widgets\Select2::classname(), ['initValueText' => $model->sn, 'pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 1, 'ajax' => ['url' => \yii\helpers\Url::to(['/admin/brand/get-brand']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }')], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('formatRepo'), 'templateSelection' => new JsExpression('function (brand) {return brand.id;}')]]);
?>
<?php
echo $form->field($model, 'cn_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'en_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'py_name')->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'initial')->widget(\yii\widgets\MaskedInput::className(), ['mask' => 'A']);
示例11: function
</div>
<div class="col-md-12">
<?php
echo $gvScdlHeader;
?>
</div>
</div>
</div>
</div>
</div>
<?php
// save via ajax : author wawan
$this->registerJs("\n \$.fn.modal.Constructor.prototype.enforceFocus = function(){};\n \$('#Scheduleheader').on('beforeSubmit',function(){\n\t\t\t\t var val = \$('#scheduleheader-scdl_group').val();\n\t\t\t\t var val1 = \$('#scheduleheader-user_id').val();\n\t\t\t\t if(val == '' && val1 == '')\n\t\t\t\t {\n\t\t\t\t\t \talert('your check field dont exist');\n\t\t\t\t }\n\t\t\t\t else{\n\t\t\t\t\t var tgl2 = \$('#tglakhir').val();\n\t\t\t\t\t var tgl1 = \$('#tglawal').val();\n\t\t\t\t\t var scdl_group = \$('#scheduleheader-scdl_group').val();\n\t\t\t\t\t var user_id = \$('#scheduleheader-user_id').val();\n\t\t\t\t\t var note = \$('#note').val();\n\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\t\turl: '/master/schedule-header/jsoncalendar_add',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: {tgl2 :tgl2,scdl_group :scdl_group,tgl1:tgl1,user_id:user_id,note:note},\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tsuccess: function(result) {\n\t\t\t\t\t\t\t\tif (result == 1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\$(document).find('#confirm-permission-alert').modal('hide');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\$.pjax.reload({container:'#gv-schedule-id'});\r\n\t\t\t\t\t\t\t\t\t\t\t\t \$('form#Scheduleheader').trigger('reset');\n\t\t\t\t\t\t\t\t\t\t\t\t \$.pjax.reload({container:'#calendar'});\r\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t alert('maaf untuk tanggal ini sudah di booking');\n\t\t\t\t\t\t\t\t\t\t\$('form#Scheduleheader').trigger('reset');\n\t\t\t\t\t\t\t\t\t // \$(document).find('#confirm-permission-alert').modal('hide');\n\t\t\t\t\t\t\t\t\t\t\t // \$.pjax.reload({container:'#gv-schedule-id'});\n\t\t\t\t\t\t\t\t\t\t\t // \$.pjax.reload({container:'#calendar'});\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t});\n\n\t\t\t\t }\n\n return false;\n });\n ", $this::POS_READY);
// author wawan
Modal::begin(['id' => 'confirm-permission-alert', 'size' => Modal::SIZE_SMALL]);
$form = ActiveForm::begin(['id' => $model->formName()]);
echo $form->field($model, 'TGL1')->Hiddeninput(['id' => 'tglawal'])->label(false);
echo $form->field($model, 'TGL2')->Hiddeninput(['id' => 'tglakhir'])->label(false);
echo $form->field($model, 'SCDL_GROUP')->widget(Select2::classname(), ['data' => $datagroup, 'options' => ['placeholder' => 'Select Group ...'], 'pluginOptions' => ['allowClear' => true]]);
echo $form->field($model, 'USER_ID')->widget(Select2::classname(), ['data' => $datauser, 'options' => ['placeholder' => 'Select User ...'], 'pluginOptions' => ['allowClear' => true]]);
echo $form->field($model, 'NOTE')->Textarea(['rows' => 2, 'id' => 'note'])->label('KETERANGAN');
echo '<div style="text-align:right; padding-top:10px">';
echo Html::submitButton('save', ['class' => 'btn btn-success']);
echo '</div>';
ActiveForm::end();
Modal::end();
// create user crm via modal : author wawan
$this->registerJs("\n\t \$.fn.modal.Constructor.prototype.enforceFocus = function(){};\n\t \$('#modal-create').on('show.bs.modal', function (event) {\n\t\tvar button = \$(event.relatedTarget)\n\t\tvar modal = \$(this)\n\t\tvar title = button.data('title')\n\t\tvar href = button.attr('href')\n\t\t//modal.find('.modal-title').html(title)\n\t\tmodal.find('.modal-body').html('<i class=\"fa fa-spinner fa-spin\"></i>')\n\t\t\$.post(href)\n\t\t\t.done(function( data ) {\n\t\t\t\tmodal.find('.modal-body').html(data)\n\t\t\t});\n\t\t})\n", $this::POS_READY);
Modal::begin(['id' => 'modal-create', 'header' => '<div style="float:left;margin-right:10px" class="fa fa-2x fa-book"></div><div><h4 class="modal-title">User</h4></div>', 'headerOptions' => ['style' => 'border-radius:5px; background-color: rgba(97, 211, 96, 0.3)']]);
Modal::end();
示例12:
/* @var $this yii\web\View */
/* @var $model backend\models\HospitalAssignment */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="hospital-assignment-form">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'user_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(User::find()->all(), 'id', 'username'), 'options' => ['placeholder' => 'เลือกผู้ใช้งาน ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<?php
echo $form->field($model, 'hospital_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Hospital::find()->all(), 'id', 'name'), 'options' => ['placeholder' => 'เลือกผู้ใช้งาน ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
<div class="form-group">
<?php
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例13:
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-8 col-md-5">
<?php
$data = ArrayHelper::map(State::find()->select(['id', 'name'])->asArray()->all(), 'id', 'name');
echo $form->field($model, 'stateIds')->widget(Select2::classname(), ['data' => $data, 'options' => ['placeholder' => 'Pilih Kecamatan ...'], 'pluginOptions' => ['allowClear' => true, 'multiple' => true]])->label('Kecamatan');
?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-8 col-md-5">
<?php
$data = ArrayHelper::map(TypeTools::find()->select(['id', 'name'])->asArray()->all(), 'id', 'name');
echo $form->field($model, 'typeToolsIds')->widget(Select2::classname(), ['data' => $data, 'options' => ['placeholder' => 'Pilih Jenis Alat ...'], 'pluginOptions' => ['allowClear' => true, 'multiple' => true]])->label('Jenis Alat');
?>
</div>
</div>
<div class="form-group">
<?php
echo Html::submitButton('Tampilkan', ['class' => 'btn btn-primary']);
?>
</div>
<?php
ActiveForm::end();
?>
</div>
示例14:
?>
</div> <!-- col-lg-6 -->
</div> <!-- #image -->
<div id="video" class="tab-pane fade">
<div class="col-lg-6">
<?php
echo $form->field($model, 'video', ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-film"></i>']]])->textInput(['maxlength' => true]);
?>
<?php
echo $form->field($model, 'video_type')->widget(Select2::classname(), ['data' => $select2videotype, 'addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-film"></i>']]]);
?>
</div> <!-- end col-lg-6 -->
<div class="col-lg-6">
<?php
echo $form->field($model, 'video_caption', ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-facetime-video"></i>']]])->textarea(['maxlength' => 255, 'rows' => 6]);
?>
<?php
echo $form->field($model, 'video_credits', ['addon' => ['prepend' => ['content' => '<i class="glyphicon glyphicon-barcode"></i>']]])->textInput(['maxlength' => 255]);
?>
示例15:
</div>
<div class="col-xs-4">
<?php
echo $form->field($model, 'status')->widget(SwitchInput::classname(), ['type' => SwitchInput::CHECKBOX]);
?>
</div>
</div>
<?php
echo $form->field($model, 'description')->textArea(['rows' => 4, 'maxlength' => 155, 'placeholder' => Yii::t('app', 'This description also used as meta description')]);
?>
<?php
echo $form->field($model, 'tags')->widget(Select2::classname(), ['options' => ['placeholder' => Yii::t('app', 'Put additional tags ...')], 'data' => $model->getTags(), 'pluginOptions' => ['tags' => true, 'tokenSeparators' => [',', ' ']]]);
?>
</div>
<div class="col-md-6">
<div class="well">
<?php
echo $form->field($model, 'time')->widget(DateTimePicker::classname(), ['options' => ['placeholder' => 'Select media time ...', 'readonly' => true], 'removeButton' => false, 'convertFormat' => true, 'pluginOptions' => ['format' => 'yyyy-MM-dd HH:i:s', 'todayHighlight' => true]]);
?>
<div class="row">
<div class="col-md-12">
<?php
if ($module->enableUpload) {