/** * * 博客文章显示 * @param int id 可以根据接受的id显示博客文章 */ public function index() { $PS = new PaperService(); if (I('get.id')) { $postId = I('get.id', '', 'intval'); $post = $PS->getFetchForum($postId); } else { $post = $PS->getFetchForum(); } #获得文章下的评论 $comments = $PS->getFetchComment($post['id']); $this->assign('comments', $comments); $this->assign('post', $post); $this->display('article'); }