I want to install Select 2 extension widget manually with Yii2 Framework without using composer.
I done the following steps but it's not working.
1) Added yii2-widget-select2
to vendor/yii-soft
2) Added following code in my yii-soft/extensions.php
:
'yiisoft/yii2-widget-select2' => array(
'name' => 'yiisoft/yii2-widget-select2',
'version' => '2.0.3.0',
'alias' =>
array(
'@yii/kartik' => $vendorDir . '/yiisoft/yii2-widget-select2',
),
),
3) Added display in view form:
use kartikselect2Select2;
<?php echo Select2::widget([
'model' => $model,
'attribute' => 'state_2',
'data' => $data,
'options' => ['placeholder' => 'Select a state ...'],
'pluginOptions' => [
'allowClear' => true,
],
]); ?>
And It shows the following error:
See Question&Answers more detail:osPHP Fatal Error – yiiaseErrorException. Class 'kartikselect2Select2' not found