/** * 具体文章显示 * @return string */ public function actionArticle() { $categoryName = Yii::$app->request->get('dir'); $articleName = Yii::$app->request->get('name'); $categoryModel = new Category(); $articleInfo = $categoryModel->getArticleBody($categoryName, $articleName); $parser = new GithubMarkdown(); $articleInfo['content'] = $parser->parse($articleInfo['content']); $articleInfo['category'] = $categoryName; return $this->render('article', ['article' => $articleInfo]); }