*/ public function actionView($id = null) { if (is_null($id)) { $id = Yii::$app->user->id; } $user = User::findOne($id); $profile = Profile::findOne($id); $query = $profile->getRatings(); $countQuery = clone $query; $pages = new Pagination(['totalCount' => $countQuery->count()]); $ratings = $query->offset($pages->offset) ->limit($pages->limit) ->all(); return $this->render( 'view',