monken/tablesigniter 问题修复 & 功能扩展

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

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

monken/tablesigniter

Composer 安装命令:

composer create-project monken/tablesigniter

包简介

CodeIgniter4 starter app

README 文档

README

Latest Stable Version Total Downloads License

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

  1. CodeIgniter Framework 4.*
  2. 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();
}
  1. 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.

  2. 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()".

  3. 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 monken/tablesigniter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 3.24k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 21
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-26