simondevelop/array-organize
Composer 安装命令:
composer require simondevelop/array-organize
包简介
Php library for easy sorting of data, generate html table and more.
关键字:
README 文档
README
array-organize
Php library for easy sorting of data, generate html table and more.
composer require simondevelop/array-organize
Example
<?php // index.php require "vendor/autoload.php"; use SimonDevelop\ArrayOrganize; $data = [ ["id" => 2, "name" => "example 5"], ["id" => 1, "name" => "example 5"], ["id" => 3, "name" => "example 3"], ["id" => 6, "name" => "example 5"], ["id" => 5, "name" => "example 3"], ["id" => 4, "name" => "example 6"], ["id" => 7, "name" => "example 6"], ["id" => 8, "name" => "example 7"], ["id" => 9, "name" => "example 7"], ["id" => 10, "name" => "example 5"] ]; if (isset($_GET['p'])) { $page = $_GET['p']; } else { $page = 1; } // Init object with data, number by page and current page number $obj = new ArrayOrganize($data, 3, $page); // Sort data $obj->dataSort("id", "ASC"); // Filter data // $obj->dataFilter(["name" => "example 5"]); // Css class for the table balise (example with bootstrap 4) $cssClass = ['table', 'table-striped']; // Settings of pagination $pager = [ "position" => "bottom", "lang" => [ "previous" => "<< Previous", "next" => "Next >>" ], "cssClass" => [ "ul" => "pagination", "li" => "page-item", "a" => "page-link", "disabled" => [ "li" => "disabled" ], "active" => [ "li" => "active" ] ], "url" => "index.php?p={}" ]; ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ArrayOrganize</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous"> </head> <body> <div class="container"> <?php // Generate html table (with pager on second parameter) echo $obj->generateTable($cssClass, $pager); ?> </div> </body> </html>
Check this docs for more.
Go to contribute !
- Check the Code of Conduct
- Check the Contributing file
- Check the Pull Request Template
License
simondevelop/array-organize 适用场景与选型建议
simondevelop/array-organize 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.12k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「pagination」 「array」 「sort」 「table」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 simondevelop/array-organize 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 simondevelop/array-organize 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 simondevelop/array-organize 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A set of useful PHP classes.
DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, which will add advanced interaction controls to any HTML table.
Syntactic sugar for PHP's sorting
Easily provide front-end sorting controls for SilverStripe lists
Plug-ins for DataTables
Trait providing methods to set class properties with an array.
统计信息
- 总下载量: 5.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-18