定制 hermawan/codeigniter4-datatables 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hermawan/codeigniter4-datatables

最新稳定版本:v0.8.0

Composer 安装命令:

composer require hermawan/codeigniter4-datatables

包简介

Serverside Datatables library for CodeIgniter4

README 文档

README

Donate Total Downloads GitHub repo size GitHub

Server-side Datatables library for CodeIgniter4 PHP framework CodeIgniter4-DataTables is CodeIgniter4 Library to handle server-side processing of DataTables jQuery Plugin via AJAX option by using Query Builder CodeIgniter 4

Documentation

For more complete example and demo please visit Documentation here

Requirements

  • Codeigniter 4.x
  • jQuery DataTables v1.10.x

Installing

Using composer

Use composer to install CodeIgniter4-DataTables into your project :

composer require hermawan/codeigniter4-datatables

Simple Initializing

Using CodeIgniter Query Builder

This is simple basic code just write DataTable::of($builder) call method toJson() for output

$builder is CodeIgniter build-in Query Builder object.

Controller :

use \Hermawan\DataTables\DataTable; public function ajaxDatatable() { $db = db_connect(); $builder = $db->table('customers')->select('customerNumber, customerName, phone, city, country, postalCode'); return DataTable::of($builder)->toJson(); }

Using CodeIgniter Model

You can initialize using Model instead Query Builder This is simple example basic code

Controller :

use \Hermawan\DataTables\DataTable; use \App\Models\CustomerModel; public function ajaxDatatable() { $customerModel = new CustomerModel(); $customerModel->select('customerNumber, customerName, phone, city, country, postalCode'); return DataTable::of($customerModel)->toJson(); }

Javascript :

$(document).ready(function() { $('#table').DataTable({ processing: true, serverSide: true, ajax: '<?php echo site_url('customers/ajaxDatatable'); ?>' }); });

For more complete example and demo please visit Documentation here

统计信息

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

GitHub 信息

  • Stars: 110
  • Watchers: 11
  • Forks: 43
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固