欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

yii2框架中使用下拉菜單的自動(dòng)搜索yii-widget-select2實(shí)例分析

 更新時(shí)間:2016年01月09日 11:10:55   作者:rogerzhanglijie  
這篇文章主要介紹了yii2框架中使用下拉菜單的自動(dòng)搜索yii-widget-select2的方法,介紹了yii-widget-select2的下載,安裝及具體使用技巧,需要的朋友可以參考下

本文實(shí)例講述了yii2框架中使用下拉菜單的自動(dòng)搜索yii-widget-select2的方法。分享給大家供大家參考,具體如下:

github中源代碼地址:https://github.com/kartik-v/yii2-widget-select2

利用composer.phar安裝此插件:

php composer.phar require kartik-v/yii2-widget-select2 "*"

引用方法:

use kartik\select2\Select2;

源代碼:

<?= $form->field($model, 'companies_company_id')->widget(Select2::classname(), [
  'data' => ArrayHelper::map(Companies::find()->all(),'company_id','company_name'),
  'language' => 'en',
  'options' => ['placeholder' => 'Select a state ...'],
  'pluginOptions' => [
    'allowClear' => true
  ],
]); ?>

相關(guān)內(nèi)容的詳細(xì)解釋?zhuān)?a target="_blank" >http://demos.krajee.com/widget-details/select2

希望本文所述對(duì)大家基于Yii框架的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論