当前位置: 首页>>代码示例>>PHP>>正文


PHP Select2::className方法代码示例

本文整理汇总了PHP中kartik\select2\Select2::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Select2::className方法的具体用法?PHP Select2::className怎么用?PHP Select2::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kartik\select2\Select2的用法示例。


在下文中一共展示了Select2::className方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

?>

    <?php 
echo $form->field($model, 'model');
?>

    <?php 
echo $form->field($model, 'mask');
?>

    <?php 
echo $form->field($model, 'mac');
?>

    <?php 
echo $form->field($model, 'status', ['options' => ['class' => 'form-group']])->widget(Select2::className(), ["data" => ['-1' => '未管理', '0' => '未知', '1' => '正常', '2' => '警告', '3' => '次要', '4' => '重要', '5' => '严重'], 'options' => ['placeholder' => '选择状态'], 'pluginOptions' => ['allowClear' => true, 'width' => '200']]);
?>

    <?php 
// echo $form->field($model, 'lastPoll')
?>

    <?php 
// echo $form->field($model, 'categoryId')
?>

    <?php 
// echo $form->field($model, 'supportPing')
?>

    <?php 
开发者ID:ThreePeple,项目名称:xjqjsjpgldjkkuiloojjloj,代码行数:31,代码来源:_search.php

示例2: alert

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

    <?php 
echo $form->field($model, 'image[]')->fileInput(['multiple' => true]);
?>
    <?php 
echo \bariew\postAbstractModule\widgets\ImageGallery::widget(['model' => $model, 'field' => 'thumb1']);
?>
    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => 255]);
?>
    <?php 
echo $form->field($model, 'categories')->widget(Select2::className(), ['data' => $model->categoriesList(), 'options' => ['placeholder' => false, 'multiple' => true]]);
?>

    <?php 
echo $form->field($model, 'brief')->widget(\yii\imperavi\Widget::className(), ['options' => ['minHeight' => 100, 'fileUpload' => Url::toRoute(['file-upload', 'attr' => 'brief', 'id' => $model->id]), 'imageUpload' => Url::toRoute(['image-upload', 'attr' => 'brief', 'id' => $model->id]), 'imageGetJson' => Url::toRoute(['image-list', 'attr' => 'brief', 'id' => $model->id]), 'imageUploadErrorCallback' => new \yii\web\JsExpression('function(json) { alert(json.error); }'), 'fileUploadErrorCallback' => new \yii\web\JsExpression('function(json) { alert(json.error); }')]]);
?>

    <?php 
echo $form->field($model, 'content')->widget(\yii\imperavi\Widget::className(), ['options' => ['minHeight' => 300, 'fileUpload' => Url::toRoute(['file-upload', 'attr' => 'content', 'id' => $model->id]), 'imageUpload' => Url::toRoute(['image-upload', 'attr' => 'content', 'id' => $model->id]), 'imageGetJson' => Url::toRoute(['image-list', 'attr' => 'content', 'id' => $model->id]), 'imageUploadErrorCallback' => new \yii\web\JsExpression('function(json) { alert(json.error); }'), 'fileUploadErrorCallback' => new \yii\web\JsExpression('function(json) { alert(json.error); }')]]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList($model->statusList());
?>

    <div class="form-group text-right">
开发者ID:bariew,项目名称:yii2-module-abstract-post,代码行数:30,代码来源:_form.php

示例3:

</td>
                                    <td><?php 
echo Yii::t('app', 'Credit');
?>
</td>
                                    <td><?php 
echo Yii::t('app', 'Debit');
?>
</td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <?php 
echo $form->field($model, 'account_id', ['template' => '{input}'])->widget(Select2::className(), ['data' => \yii\helpers\ArrayHelper::map(Accounts::find()->All(), 'id', 'name')]);
?>
                                    </td>
                                    <td>
                                        <span id="nameTransactions_account_id"></span>
                                    </td>
                                    
                                    <td>
                                        <input size="6" id="sourcepos" type="text" class="number" name="FormTransaction[sourcepos]" onchange="CalcSum()" value="0">
                                    </td>
                                    <td>
                                        <input size="6" id="sourceneg" type="text" class="number" name="FormTransaction[sourceneg]" onchange="CalcSum()" value="0">
                                    </td>
                                </tr>
                            </tbody>
                            <tfoot>
开发者ID:chaimvaid,项目名称:linet3,代码行数:31,代码来源:create.php

示例4: enumerate

 public static function enumerate(ActiveRecord $model, $attribute, $options = [])
 {
     $choices = ModelHelper::getEnumChoices($model, $attribute);
     $config = [$attribute, 'widget', 'widgetClass' => Select2::className(), 'data' => $choices, 'options' => ['placeholder' => 'Select...']];
     return ArrayHelper::merge($config, $options);
 }
开发者ID:vladdnepr,项目名称:yii2-ycm-utils,代码行数:6,代码来源:EditHelper.php

示例5:

		    	 $("#dscAudiencia").show();
				 $("#nmProcesso").hide();
		    }
		});
	}
</script>
<div class="audiencia-form">

	<div id="audiencia" class="col-lg-12" ng-controller="audienciaController" ng-init="init()">
    	<?php 
$form = ActiveForm::begin(['id' => 'audienciaForm']);
?>
    	
    	<div class="col-lg-4">
	    	<?php 
echo $form->field($model, 'id_tipo_audiencia')->label('')->widget(Select2::className(), ['data' => ArrayHelper::map(TipoAudiencia::find()->all(), 'id', 'dsc_tipo_audiencia'), 'options' => ['onChange' => 'toggleCampoAudiencia(this,"' . Url::to(['tipo-audiencia/getflag']) . '")', 'placeholder' => 'Selecione o tipo da audiência']]);
?>
    	</div>
    	
    	<div id="dscAudiencia" class="col-lg-4" style="display:none">
	    	<?php 
echo $form->field($model, 'dsc_audiencia')->textInput(['maxlength' => true]);
?>
    	</div>
    	
    	<div id="nmProcesso" class="col-lg-4" style="display:none">
	    	<?php 
echo $form->field($model, 'nm_processo')->textInput(['maxlength' => true]);
?>
    	</div>
    	
开发者ID:ulissesvaquero,项目名称:audienciadigital,代码行数:30,代码来源:_form.php

示例6:

app\widgets\MiniForm::begin(array('header' => Yii::t('app', "Create deposit")));
?>

<?php 
$form = kartik\form\ActiveForm::begin(array('id' => 'deposit-form', 'enableAjaxValidation' => true));
$temp = \yii\helpers\ArrayHelper::map(Accounts::findAllByType(7), 'id', 'name');
$temp[''] = Yii::t('app', 'Choose Bank');
//$model->account_id = 0;
?>


<div class='row'>
    <div class='col-md-3'>

        <?php 
echo $form->field($model, "account_id")->widget(Select2::className(), ['data' => $temp]);
?>
        <?php 
echo $form->field($model, 'refnum');
?>
        <?php 
echo $form->field($model, 'date')->widget(DateControl::classname(), ['type' => 'date']);
?>

    </div>
    <div class='col-md-3'>
        <?php 
echo $form->field($model, 'cheq_sum')->textInput(['readonly' => true]);
?>
        <?php 
echo $form->field($model, 'cash_sum')->textInput(['readonly' => true]);
开发者ID:chaimvaid,项目名称:linet3,代码行数:31,代码来源:admin.php

示例7:

?>
            <div>
                <?php 
echo \app\widgets\Refnum::widget(['model' => $model, 'attribute' => 'refnum']);
?>
            </div>



            <?php 
echo $form->field($model, 'date')->widget(DateControl::classname(), ['type' => 'date']);
?>
            

            <?php 
echo $form->field($model, 'opp_account_id')->widget(Select2::className(), ['data' => \yii\helpers\ArrayHelper::map(Accounts::find()->where(array('type' => 7))->all(), 'id', 'name')]);
//7=banks
?>



            <div class="form-actions">
                <?php 
echo \yii\helpers\Html::submitButton(Yii::t('app', 'Create'), ['class' => 'btn btn-success']);
?>
            </div>

            <?php 
kartik\form\ActiveForm::end();
?>
            
开发者ID:chaimvaid,项目名称:linet3,代码行数:30,代码来源:_form.php

示例8: function

    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
$idTags = Html::getInputId($model, 'tags');
$handlerJs = <<<JS
function(data) {
    var select = \$("#{$idTags}").append('<option value="' + data.id + '">' + data.title + '</option>'),
        selectedValues = select.val() || [];
        selectedValues.push(data.id);

    select.val(\$.unique(selectedValues)).trigger('change');
}
JS;
echo $form->field($model, 'tags', ['wrapperOptions' => ['class' => 'col-sm-9'], 'inputTemplate' => '<div class="input-group select2-bootstrap-append">{input}' . \gromver\widgets\ModalIFrame::widget(['options' => ['class' => 'input-group-addon', 'title' => \Yii::t('gromver.platform', 'Select Tag')], 'label' => '<i class="glyphicon glyphicon-folder-open"></i>', 'url' => ['/tag/backend/default/select', 'modal' => true], 'dataHandler' => $handlerJs]) . \gromver\widgets\ModalIFrame::widget(['options' => ['class' => 'input-group-addon', 'title' => \Yii::t('gromver.platform', 'Add Tag')], 'label' => '<i class="glyphicon glyphicon-plus"></i>', 'url' => ['/tag/backend/default/create', 'modal' => true], 'dataHandler' => $handlerJs]) . '</div>'])->widget(\kartik\select2\Select2::className(), ['data' => \yii\helpers\ArrayHelper::map($model->tags, 'id', 'title'), 'options' => ['multiple' => true], 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'pluginOptions' => ['multiple' => true, 'placeholder' => Yii::t('gromver.platform', 'Select ...'), 'ajax' => ['url' => \yii\helpers\Url::to(['/tag/backend/default/tag-list'])]]]);
?>
        </div>
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'ordering', ['horizontalCssClasses' => ['wrapper' => 'col-xs-8 col-sm-4', 'label' => 'col-xs-4 col-sm-3']])->textInput();
?>
        </div>
    </div>

    <?php 
//описание версии удобнее выставлять в списках версий
//= $form->field($model, 'versionNote')->textInput()
?>

    <ul class="nav nav-tabs">
开发者ID:ezsky,项目名称:yii2-platform-core,代码行数:31,代码来源:_form.php

示例9:

?>

    <?php 
echo $form->field($model, 'name')->textInput();
?>

    <?php 
echo $form->field($model, 'url')->widget(\sibds\widgets\translitInput::className(), ['fromField' => 'name']);
?>

    <?php 
echo $form->field($model, 'image')->widget(\sibds\widgets\InputFile::className());
?>

    <?php 
echo $form->field($model, 'layout')->widget(\kartik\select2\Select2::className(), ['data' => Yii::$app->controller->getLayouts(), 'options' => ['placeholder' => 'Значение по умолчанию'], 'addon' => ['prepend' => ['content' => \yii\bootstrap\Html::icon('open-file')]]]);
?>

    <?php 
echo $form->field($model, 'description')->widget(\sibds\widgets\CKEditor::className(), ['options' => ['rows' => 6]]);
?>

    <?php 
echo \sibds\form\FormFooter::widget(['model' => $model]);
?>

    <?php 
ActiveForm::end();
?>

</div>
开发者ID:sibds,项目名称:playground,代码行数:31,代码来源:_form.php

示例10: JsExpression

?>

    <?php 
$form = ActiveForm::begin(['id' => 'billing-form', 'method' => 'get', 'layout' => 'inline']);
?>

    <?php 
echo $form->field($searchModel, 'periodInput')->widget(DateControl::className(), ['type' => DateControl::FORMAT_DATE, 'options' => ['options' => ['placeholder' => 'Период...'], 'pluginOptions' => ['autoclose' => true, 'minViewMode' => 1]], 'saveFormat' => 'php:n' . $searchModel::PERIOD_DELIMITER . 'Y', 'displayFormat' => 'php:F Y']);
?>

    <?php 
echo $form->field($searchModel, 'operatorId')->dropDownList($searchModel::operatorList());
?>

    <?php 
echo $form->field($searchModel, 'items')->widget(Select2::className(), ['showToggleAll' => false, 'options' => ['multiple' => true, 'placeholder' => 'Номер или имя сотрудника...'], 'pluginOptions' => ['width' => '600', 'allowClear' => true, 'minimumInputLength' => 3, 'ajax' => ['url' => \yii\helpers\Url::to(['items-list']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term}; }'), 'delay' => 250], 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), 'templateResult' => new JsExpression('function(item) {return item.number; }'), 'templateSelection' => new JsExpression('function (item) {return item.number; }')]]);
?>

    <?php 
echo Html::submitButton('<span class="glyphicon glyphicon-search"></span>', ['class' => 'btn btn-primary']);
?>

    <?php 
ActiveForm::end();
?>

    <?php 
Pjax::begin(['formSelector' => '#billing-form', 'options' => ['style' => 'padding: 20px 0']]);
?>

    <?php 
开发者ID:shubnikofff,项目名称:mobiles,代码行数:31,代码来源:index.php

示例11:

<?php

use ut8ia\filemanager\Module;
use ut8ia\filemanager\models\Tag;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
/* @var $this yii\web\View */
$form = ActiveForm::begin(['action' => '?', 'method' => 'get']);
?>
	<?php 
echo $form->field($model, 'tagIds')->widget(\kartik\select2\Select2::className(), ['maintainOrder' => true, 'data' => ArrayHelper::map(Tag::find()->all(), 'id', 'name'), 'options' => ['multiple' => true], 'addon' => ['append' => ['content' => Html::submitButton(Module::t('main', 'Search'), ['class' => 'btn btn-primary']), 'asButton' => true]]])->label(false);
ActiveForm::end();
开发者ID:ut8ia,项目名称:yii2-filemanager,代码行数:13,代码来源:_search_form.php

示例12:

?>

    <?php 
// echo $form->field($model, 'faultTimeDesc')
?>

    <?php 
// echo $form->field($model, 'recTime')
?>

    <?php 
// echo $form->field($model, 'recTimeDesc')
?>

    <?php 
echo $form->field($model, 'recStatus', ['options' => ['class' => 'form-group']])->widget(Select2::className(), ["data" => ['0' => '未恢复', '1' => '已恢复'], 'hideSearch' => true, 'options' => ['placeholder' => '选择状态'], 'pluginOptions' => ['allowClear' => true, 'width' => '150']]);
?>

    <?php 
// echo $form->field($model, 'recStatusDesc')
?>

    <?php 
// echo $form->field($model, 'recUserName')
?>

    <?php 
// echo $form->field($model, 'ackTime')
?>

    <?php 
开发者ID:ThreePeple,项目名称:xjqjsjpgldjkkuiloojjloj,代码行数:31,代码来源:_search.php

示例13:

/* @var $model app\modules\blog\models\Post */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="post-form">

    <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>
    
    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'category_id')->widget(Select2::className(), ['data' => ArrayHelper::map(Category::find()->getActive()->all(), 'id', 'title'), 'language' => 'en', 'options' => ['placeholder' => 'Select a category ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
    <?php 
echo $form->field($model, 'description')->widget(CKEditor::className(), ['options' => ['row' => 6], 'preset' => 'basic']);
?>
    <?php 
echo $form->field($model, 'text')->widget(CKEditor::className(), ['options' => ['row' => 6], 'preset' => 'basic']);
?>
    <?php 
echo $form->field($model, 'img')->widget(FileInput::classname(), ['name' => 'img[]', 'options' => ['multiple' => true], 'pluginOptions' => ['initialPreview' => $model->img ? Html::img($model->img, ['class' => 'file-preview-image']) : '', 'overwriteInitial' => true]]);
?>
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>
开发者ID:bysobi,项目名称:blog,代码行数:31,代码来源:_form.php

示例14:

        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'alias', ['wrapperOptions' => ['class' => 'col-sm-9']])->textInput(['maxlength' => 255, 'placeholder' => Yii::t('gromver.platform', 'Auto-generate')]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'status', ['wrapperOptions' => ['class' => 'col-sm-9']])->dropDownList(['' => Yii::t('gromver.platform', 'Select ...')] + $model->statusLabels());
?>
        </div>
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'group', ['wrapperOptions' => ['class' => 'col-sm-9']])->widget(\kartik\select2\Select2::className(), ['theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'data' => \yii\helpers\ArrayHelper::map(\gromver\platform\core\modules\tag\models\Tag::find()->groupBy('group')->andWhere('[[group]] != "" AND [[group]] IS NOT NULL')->all(), 'group', 'group'), 'pluginOptions' => ['tags' => true, 'allowClear' => true, 'multiple' => false, 'placeholder' => Yii::t('gromver.platform', 'Select ...')]]);
?>
        </div>
    </div>

    <ul class="nav nav-tabs">
        <li class="active"><a href="#meta-options" data-toggle="tab"><?php 
echo Yii::t('gromver.platform', 'SEO');
?>
</a></li>
    </ul>
    <br/>
    <div class="tab-content">
        <div id="meta-options" class="tab-pane active">
            <?php 
echo $form->field($model, 'metakey')->textInput(['maxlength' => 255]);
开发者ID:ezsky,项目名称:yii2-platform-core,代码行数:31,代码来源:_form.php

示例15:

        <div class="col-lg-6"> 
            <?php 
echo $form->field($model, 'tag_name_en')->textInput();
?>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'parent_id')->widget(Select2::className(), ['data' => Tags::getTagsList(), 'options' => ['placeholder' => 'Select parent tag..', 'multiple' => false], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'tag_type')->widget(Select2::className(), ['data' => TagType::getTagTypeList(), 'options' => ['tags' => true, 'placeholder' => 'Select tag type..', 'multiple' => false], 'pluginOptions' => ['allowClear' => true]]);
?>
        </div>
    </div>
    <hr>

    <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();
?>
开发者ID:abutouq,项目名称:video,代码行数:30,代码来源:_form.php


注:本文中的kartik\select2\Select2::className方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。