TP5之自定義分頁樣式
阿新 • • 發佈:2021-12-22
- 分頁樣式為
- 在extend\目錄下建立page目錄,在page目錄下建立Page.php檔案,將以下程式碼放入檔案中。
<?php namespace page; use think\Paginator; class Page extends Paginator { //首頁 protected function home() { if ($this->currentPage() > 1) { return "<a href='" . $this->url(1) . "' title='首頁'>首頁</a>
修改 application\config.php 中的配置檔案即可
//分頁配置 'paginate' => [ 'type' => 'page\Page',//分頁類 'var_page' => 'page', 'list_rows' => 15, ],