thinkphp6/thinkphp-extend-paginator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thinkphp6/thinkphp-extend-paginator

Composer 安装命令:

composer require thinkphp6/thinkphp-extend-paginator

包简介

ThinkPHP 6 分页扩展

README 文档

README

内含以下前端框架的分页驱动

安装

Usage is simple, to install, add the following to your project's composer.json:

    "repositories": [
        {
            "url": "https://github.com/thinkphp6/thinkphp-extend-paginator.git",
            "type": "git"
        }
    ]

Then add the library in the usual way using composer:

composer require thinkphp6/thinkphp-extend-paginator:dev-main

配置

1.服务提供定义文件里重新绑定服务

编辑app/provider.php文件,在该文件里重新绑定think\Paginator分页服务,该方法适用于ThinkPHP6,全局生效。

return [
    'think\Paginator' => \wanyi\thinkExtendPaginator\Bootstrap4::class
];

2.公共函数文件里绑定服务

编辑app/common.php文件,在该文件里重新绑定think\Paginator分页服务,该方法适用于ThinkPHP6,全局生效。
如果想单应用生效,请在应用的公共函数文件里重新绑定think\Paginator分页服务,如:app/admin/common.php

// 设置服务注入
\think\facade\App::bind('think\Paginator', \wanyi\thinkExtendPaginator\Bootstrap4::class);

如果只想一个地方生效,可以在进行分页查询前,使用该代码重新绑定think\Paginator分页服务。

// 设置服务注入
\think\facade\App::bind('think\Paginator', \wanyi\thinkExtendPaginator\Bootstrap4::class);

// 获取users表数据并进行分页
$list = \think\facade\Db::table('users')->paginate();

3.配置文件里定义分页类

编辑config/paginate.php文件
修改type配置项的值为\wanyi\thinkExtendPaginator\Bootstrap4::class,
该方法仅适用于ThinkPHP5.1.

return [
    'type' => \wanyi\thinkExtendPaginator\Bootstrap4::class,
];

已支持的前端框架

Bootstrap4 - 5

框架官方文档:https://getbootstrap.com/docs/4.0/components/pagination/
框架官方文档:https://getbootstrap.com/docs/5.0/components/pagination/

\think\facade\App::bind('think\Paginator', \bigDream\thinkPaginatorDriver\Bootstrap4::class);
\think\facade\App::bind('think\Paginator', \bigDream\thinkPaginatorDriver\Bootstrap5::class);

Layui

框架官方文档:https://www.layui.com/doc/modules/laypage.html

\think\facade\App::bind('think\Paginator', \bigDream\thinkPaginatorDriver\Layui::class);

Amaze UI

框架官方文档:https://amazeui.clouddeep.cn/css/pagination/

\think\facade\App::bind('think\Paginator', \bigDream\thinkPaginatorDriver\AmazeUI::class);

Foundation

框架官方文档:https://foundation.zurb.com/sites/docs/pagination.html

\think\facade\App::bind('think\Paginator', \bigDream\thinkPaginatorDriver\Foundation::class);

说明

其它

你所用的前端框架不在这里?欢迎提交PR,或者在Issues里告诉我。

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固