Cml\Vendor\Page::__construct PHP Метод

__construct() публичный Метод

构造函数
public __construct ( integer $totalRows, integer $numPerPage = 20, array $param = [] )
$totalRows integer 总行数
$numPerPage integer 每页显示条数
$param array 分页跳转时带的参数 如:['name' => '张三']
    public function __construct($totalRows, $numPerPage = 20, $param = [])
    {
        $this->totalRows = $totalRows;
        $this->numPerPage = $numPerPage ? intval($numPerPage) : 10;
        $this->pageShowVarName = Config::get('var_page') ? Config::get('var_page') : 'p';
        $this->param = $param;
        $this->totalPages = ceil($this->totalRows / $this->numPerPage);
        $this->coolPages = ceil($this->totalPages / $this->barShowPage);
        $this->nowPage = Input::getInt($this->pageShowVarName, 1);
        if ($this->nowPage < 1) {
            $this->nowPage = 1;
        } elseif (!empty($this->totalRows) && $this->nowPage > $this->totalPages) {
            $this->nowPage = $this->totalPages;
        }
        $this->firstRow = $this->numPerPage * ($this->nowPage - 1);
    }