Пример #1
0
 public function subDropDown($parent, $space = '|---')
 {
     global $data;
     $children = Categories::find()->where(['parent_id' => $parent])->all();
     foreach ($children as $child) {
         $data[$child->id] = $space . ' ' . $child->title;
         Categories::subDropDown($child->id, $space . '---');
     }
 }