承接 tu9/tu9-pagination 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

tu9/tu9-pagination

最新稳定版本:1.0.6

Composer 安装命令:

composer create-project tu9/tu9-pagination

包简介

This is tu9 pagination view component package

README 文档

README

1. Introduction

In other frameworks, pagination can be very painful. We hope approach to pagination will be a breath of fresh air. Pagination package is integrated with the query builder and Eloquent ORM and provides convenient, easy-to-use pagination of database records with zero configuration.

2. Installation

Pretty simple with Composer, run

composer require tu9/tu9-pagination

3. Displaying Pagination Results

Usage

Enable pagination:

use App\Models\YourModel;

Route::get('/url', function () {
    return YourModel::paginate();
});

Show pagination at view pages:

<x-tu9-pagination :paginator="$paginator" :pageSize="$pageSize" :filter="$filter" />

Declare variables require

$paginator is the data you want to paginate

$paginator = YourModel::paginate();

$pageSize is the number of pages to display (including First Page and Last Page)

$pageSize = 5;

Display:
First 1 2 3 Last

$filter is defined as an array of input or select data. It includes $key & $value.

In which:

$key is the name of the input or selected

$value is the string keyword of the input or selected

Data after filtering will continue to be paginated with $key & $value.

4. Customize display

Optional variable

$stylePaginator: customize pagination section display

$stylePaginator = "display: flex;
    justify-content: center;
    margin-top: 20px";

$stylePaginatorLink: customize pagination items display

$stylePaginatorLink = "color: black;
    float: left;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color .3s;
    border: 1px solid #ddd;
    margin: 0 4px;";
    
    

$stylePaginatorLinkActive: customize pagination items active display

$stylePaginatorLinkActive = "color: white;
    float: left;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color .3s;
    border: 1px solid #ddd;
    margin: 0 4px;
    background-color: #0d6efd;
    border: 1px solid #0d6efd;
    ";
 

$nextPage: customize show/none the next page

$nextPage = [
  'display' => 'show',
  'text' => 'Next',

];

$previousPage: customize show/none the previous page

$previousPage = [
      'display' => 'show',
      'text' => 'Previous',
    ];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-18