Skip to content

Instantly share code, notes, and snippets.

@kdes70
Created July 16, 2015 16:54
Show Gist options
  • Save kdes70/3fe5ad604f9be928201f to your computer and use it in GitHub Desktop.
Save kdes70/3fe5ad604f9be928201f to your computer and use it in GitHub Desktop.
Yii2 Рендер категорий выподающем списке в виде дерева
<?=$form->field($offer, 'categories_list')->dropDownList(
ArrayHelper::map($categories,'id',function($value){ return str_repeat('-',count(explode('.',$value->path) )) . $value->name ;} ),
['multiple' => true]);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment