I need help on the select widget for kartik as used in yii2 advanced template. Data is being fetched correctly and i can print it using the print_r function.
<?php
$facultiesData = Faculties::find()
->select(['faculty_id','faculty_name'])
->asArray()
->all();
$facultiesData = ArrayHelper::map( $facultiesData, 'faculty_id','faculty_name' );
print_r($facultiesData); //print values on screen
?>
the problem is,this data is not being populated in the form field with kartik select widget
<?= $form->field($model, 'faculty_id')->widget(Select2::classname(), [
'data' => $facultiesData,
'language' => 'en',
'options' => ['placeholder' => 'choose property ...'],
'pluginOptions' => [
'allowClear' => true
],
]);
?>
Thanks in advance. I will appreciate any lead or help