/** * 展示首页 * @return \Illuminate\Http\Response */ public function index() { // 查询出文章列表 $total = array(); $to = 5; if (isset($_GET['fr'])) { $nowpage = $_GET['fr']; $fr = ($nowpage - 1) * $to; } else { $nowpage = 1; $fr = 0; } $res = Articles::getArticleList($fr, $to); $countall = Articles::getTotalCount(); $total['articleList'] = $res; $total['countall'] = $countall; $total['nowpage'] = $nowpage; //显示首页 return view('index/indexmain', $total); }