whykrr/datatables-builder
Composer 安装命令:
composer require whykrr/datatables-builder
包简介
Builder datatables serverside processing for Codeigniter 4
README 文档
README
builder response datatables serverside processing for Codeigniter 4
Requirements
- PHP 7+
- Codeigniter 4.0.0+
Installation
Installation is best done via Composer. Assuming Composer is installed globally, you may use the following command:
composer require whykrr/datatables-builder
Manual Installation
Should you choose not to use Composer to install, you can clone or download this repo and then enable it by editing app/Config/Autoload.php and adding the Myth\Auth namespace to the $psr4 array. For example, if you copied it into app/ThirdParty:
$psr4 = [ 'Config' => APPPATH . 'Config', APP_NAMESPACE => APPPATH, 'App' => APPPATH, 'DatatablesBuilder' => APPPATH .'ThirdParty/datatablesbuilder/src', ];
Features
- Serverside data datatables with pagination
- Helper for initiation datatables
- Customize search datatables
- Customize data with helper function
Configuration
Once installed you need to configure the framework to use the DatatablesBuilder library. In your application, perform the following setup
Publish configuration file and JavaScript file with following command
php spark dtbuilder:publish
You can easily add configuration on App/Config/Datatables.php
Setup your table with $tableSetting variable:
// Example configuration public $tableSetting = [ 'users' => [ 'col_title' => 'First Name,Last Name,Adress,Status', 'col_data' => 'first_name,last_name,address,status', 'helpers' => [ 'status' => ['formatStatus', '{status}'], ], 'numbering' => true, 'action_button' => 'edit,delete', ], ];
Key 'users'
'users' key must be unique, as it is used to define the table identity and API url.
then the access url for table users is {base_url}/datatables/users
Key 'col_title'
'col_title' key is used to configure column title in the table
Key 'col_data'
'col_title' key is used to configure column data in the table
Key 'helpers'
'helpers' key is used for which configuration data will be overwritten with the return of the helper function, the configuration format see the code as follows
'helpers' => [ 'key_name_tobe_overwrite' => ['function_name', 'arguments'], ],
if argument is more than one then add | as a separator between the arguments, add {key} if the argument contains the row of data to be displayed. Example : '{status}|users'
Key 'numbering'
'numbering' key is used to configure row data with numbering on first column
Key 'action_button'
'action_button' key is used to configure row data with button or links on last column
The configuration above will produce the following display
| No | Fisrt Name | Last Name | Adress | Status | Action Button |
|---|---|---|---|---|---|
| {no} | {fist_name} | {last_name} | {adress} | {status} | {action_btn} |
whykrr/datatables-builder 适用场景与选型建议
whykrr/datatables-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 40 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 02 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 whykrr/datatables-builder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 whykrr/datatables-builder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 40
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-06