public function actionSerchbook() { $searchModel = new BooksSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $count = null; if (isset(Yii::$app->request->queryParams['BooksSearch']['authors'])) { $count = \app\models\BooksAuthors::getAuthorBooks((int) Yii::$app->request->queryParams['BooksSearch']['authors']); } return $this->render('serchbook', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'count' => $count]); }