/**
  * Returns json event list for form DepDrop widget.
  */
 public function actionEvents()
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     $result = ($post = Yii::$app->request->post('depdrop_parents')) ? array_flip(ClassCrawler::getEventNames($post[0])) : [];
     $output = [];
     foreach ($result as $id => $name) {
         $output[] = compact('id', 'name');
     }
     echo Json::encode(['output' => $output, 'selected' => '']);
 }
예제 #2
0
 public static function classList()
 {
     $classes = ClassCrawler::getAllClasses();
     return array_combine($classes, $classes);
 }