PriymakVl
1/23/2020 - 11:59 AM

yii active_form select

yii active_form select

<?php 

$items = ['0' => 'Активный', '1' => 'Отключен','2'=>'Удален'];
$items = Category::find()->select('name')->where(['status' => STATUS_ACTIVE])->asArray()->indexBy('id')->column();

$params = ['prompt' => 'Выберите статус...'];

echo $form->field($model, 'status')->dropDownList($items, $params);

?>