CONCATENATED ATTRIBUTES IN DROPDOWN IN YII 2

 Source: https://stackoverflow.com/questions/27768540/yii2drop-down-list-for-multiple-values-concat-in-one-line

<?php 
echo $form->field($model, 'scholarship')->widget(Select2::classname(), [
'data' => ArrayHelper::map(ActiveIfg::find()->all(),'title',function($model) {
return $model['title'].' ('.$model['acadYear'].' / '.$model['term'].')';
}),
'language' => 'en',
'options' => ['placeholder' => 'Select scholarship'],
'pluginOptions' => [
'allowClear' => true
],
]);
?>

 

Post a Comment

0 Comments