/**
* @return mixed
*/
public function getParentCategoryName()
{
return ArrayHelper::getValue(self::getParentCategory(), $this->parent_id);
}
public static function getParentCategory()
{
$parent = ArrayHelper::map(self::findAll(['parent_id' => null]), 'id', 'name');
return $parent;
}
/**
* app\modules\production\views\backend\products\_form
* @return array
*/
public static function getChildCategoryList()
{
return ArrayHelper::map(self::find()->where(['not', ['parent_id' => null]])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name', 'parentCategoryName');
}
$form->field($model, 'associatedArray')->dropDownList(Catalog::getChildCategoryList())
когда я копирую ваш код тоже плохо))))