1.封装一个公共实体类用于返回:实体数据,当前页,总页数,总条数,每页多少条 public class PageInfo<T> { //一页显示的记录数 private int numPerPage=10; //记录总数 private int totalRows; //总页数 private int totalPages; //当前页码 private int currentPage; private List<T> list; // 总数统计 private T sumObj;
<?php namespace Home\Controller; use Think\Controller; class IndexController extends Controller { public function index(){ $s = "hello"; $this->assign("name",$s); $this->show(); } } 新建Index文件在这个文件下新建 <!DOCTYPE html PUBLIC &