예제 #1
0
 public function actionClub()
 {
     $model = new Search();
     $clubs = 1;
     if ($model->load(\Yii::$app->request->get()) && isset($model['name'])) {
         $clubs = Search::searchClubs($model['name'], $model['author'], 20, \Yii::$app->request->post('contentId'));
         if (\Yii::$app->request->isAjax) {
             echo json_encode(['content' => $clubs]);
             die;
         }
     }
     return $this->render('club', ['model' => $model, 'clubs' => $clubs]);
 }