2015-09-04 34 views
-1

得到一個錯誤不能上傳擴展卡爾蒂克選擇2獲得ISSE ....有關如何添加選擇2擴展警予

需要一些ideaaa 使用Yii要安裝選擇2延伸的分支表...

<div class="branches-form"> 

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

    <?= $form->field($model, 'branch_name')->textInput(['maxlength' => 100]) ?> 

    <?= $form->field($model, 'branch_address')->textInput(['maxlength' => 255]) ?> 


    <?= $form->field($model, 'branch_status')->dropDownList([ 'active' => 'Active', 'inactive' => 'Inactive', '' => '', ], ['prompt' => 'Status']) ?> 

    <div class="form-group"> 
     <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> 
    </div> 

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

</div> 
+0

而錯誤是?... – soju

回答

0

正確閱讀本文檔http://demos.krajee.com/widget-details/select2

嘗試這種解決方案:

還包括use kartik\select2\Select2;在您的文件的頂部。

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

我確實包括它,但同樣的問題.... –