monken/tablesigniter
Composer 安装命令:
composer create-project monken/tablesigniter
包简介
CodeIgniter4 starter app
README 文档
README
Tableslgniter is an addins base on CodeIgniter4. It will help you use jQuery Datatables in server side mode.
If you want to get CodeIgniter3 version of Tableslgniter you can go to this git repository.
Visit the sample website and read user guide.
TablesIgniter 基於 CodeIgniter4 。它將可以幫助你在 使用 server side mode 中使用 jQuery Datatables。
如果你希望取得 CodeIgniter3 版本的 Tableslgniter 你可以前往這個 git儲存庫 。
Install
Prerequisites
- CodeIgniter Framework 4.*
- Composer
Composer Install
composer require monken/tablesigniter
Use Library
Declare the following code in the controller that will use TablesIgniter.
use monken\TablesIgniter;
Quick Start
HTML
<table id="firstTable">
<thead>
<tr>
<th>id</th>
<th>title</th>
<th>date</th>
</tr>
</thead>
</table>
JavaScript
$('#firstTable').DataTable({
"aoColumnDefs": [{
"bSortable": false,
"aTargets": [ 0,1,2 ]
}],
"order":[],
"serverSide":true,
"searching": false,
"lengthChange":false,
"ajax":{
url:"<?=base_url('home/firstTable')?>",
type:'POST'
}
});
Controller
public function firstTable(){
$model = new HomeModel();
$table = new TablesIgniter();
$table->setTable($model->noticeTable())
->setOutput(["id","title","date"]);
return $table->getDatatable();
}
-
Calling the "setTable()" method must pass in a Query Builder object. TablesIgniter relies on the database query content defined by this object. This object is usually declared in the Model.
-
When calling the "setOutput()" method, the array must be passed in. The order of the array will affect the order of the data presented by DataTables. The definition of the string must be the same as the field name of the result queried by "setTable()".
-
Calling "getDatatable()" will get the json string that meets the requirements of jQuery DataTables.
Model
public function noticeTable(){
$builder = $this->db->table("news");
return $builder;
}
You are free to use all the methods of Query Builder to meet all your requirements for database query. Finally, you must return the objects generated by Query Builder.
monken/tablesigniter 适用场景与选型建议
monken/tablesigniter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.24k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2020 年 01 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「codeigniter」 「datatables」 「codeigniter4」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 monken/tablesigniter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 monken/tablesigniter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 monken/tablesigniter 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
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.
Laravel DataTables plugin to support Mongodb
Plug-ins for DataTables
The CodeIgniter Redis package
Vanilla Components Integration with Laravel
Views for the package MedicOneSystems Livewire Datatables with Bootstrap 4
统计信息
- 总下载量: 3.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 21
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-26