public function comment($type = '') { $error = NULL; $cl = NULL; $type = trim($type); try { $this->__lib('CommentList'); $cl = new CommentList($type); $cl->setPager(intval(req()->get('page')), 20); } catch (\Exception $ex) { $error = $ex->getMessage(); } switch ($type) { case 'gallery': $this->comment_gallery($cl); return; case 'pictures': $this->comment_pictures($cl); return; case 'posts': $this->comment_posts($cl); return; } $this->theme->setTitle("我的评论"); $this->theme->setBreadcrumb("我的评论"); $this->__view("User/header.php"); if (!empty($type) && $error !== NULL) { $this->__view("Follow/error.php", ['error' => $error]); } else { $this->__view("Follow/comment_chose.php"); } $this->__view("User/footer.php"); }