public function actionBlog($id, $url) { User::getUserInfoOrRedirect($this, $id, $user, $isMyProfile); $request = Yii::$app->request; $contentId = $request->post('contentId'); $articles = Blog::getUserArticle($id, 20, $url, $contentId); if ($request->isAjax) { echo json_encode(['content' => $articles]); return; } $categories = Blog::getUserBlogCategory($id); return $this->render('blog', ['articles' => $articles, 'user' => $user, 'isMyProfile' => $isMyProfile, 'categories' => $categories]); }