Answers for "select2 yii2"

3

select2 yii2

$ php composer.phar require kartik-v/yii2-widget-select2 "@dev"
Posted by: Guest on August-14-2020
0

select 2 yii2

use kartik\select2\Select2;

// Normal select with ActiveForm & model
echo $form->field($model, 'state_1')->widget(Select2::classname(), [
    'data' => $data,
    'language' => 'de',
    'options' => ['placeholder' => 'Select a state ...'],
    'pluginOptions' => [
        'allowClear' => true
    ],
]);

// Multiple select without model
echo Select2::widget([
    'name' => 'state_2',
    'value' => '',
    'data' => $data,
    'options' => ['multiple' => true, 'placeholder' => 'Select states ...']
]);
Posted by: Guest on December-18-2020

Browse Popular Code Answers by Language