請問bootstrap分頁模版文件在哪里下載
在/app/common/BootStrap.php文件下,加入代碼:
<?php
namespace app\common;
use think\paginator\driver\Bootstrap as BaseBootstrap;
class
Bootstrap extends BaseBootstrap
{
/
*
渲染分頁HTML
@
return
string
public function render(): string
if
($this
-
>hasPages()) {
sprintf(
'<nav><ul class="pagination justify-content-center">%s %s %s</ul></nav>'
,
$this
>getPreviousButton(),
>getLinks(),
>getNextButton()
);
}
'';
生成可點(diǎn)擊的頁碼按鈕
@param string $url
@param string $page
protected function getAvailablePageWrapper(string $url, string $page): string
'<li class="page-item"><a class="page-link" href="'
. htmlentities($url) .
'">'
. $page .
'</a></li>'
;
生成禁用狀態(tài)的按鈕
@param string $text
protected function getDisabledTextWrapper(string $text): string
'<li class="page-item disabled"><span class="page-link">'
. $text .
'</span></li>'
生成當(dāng)前激活的頁碼按鈕
protected function getActivePageWrapper(string $text): string
'<li class="page-item active"><span class="page-link">'
生成省略號(hào)
protected function getDots(): string
>getDisabledTextWrapper(
'...'
上一頁按鈕
protected function getPreviousButton(string $text
=
'?'
): string
>currentPage() <
1
) {
>getDisabledTextWrapper($text);
>getAvailablePageWrapper(
>url($this
>currentPage()
),
$text
下一頁按鈕
protected function getNextButton(string $text
(!$this
>hasMore) {
+