承接 emagombe/datatable 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

emagombe/datatable

Composer 安装命令:

composer require emagombe/datatable

包简介

PHP Server-side processing datatable

README 文档

README

This lib allows to process DataTable data content from server-side using PHP

Instalation

Using composer

composer require emagombe/datatable

Without composer

Clone the project or download a release from https://github.com/emagombe/datatable/releases And import autoload.php file to you project

require_once 'autoload.php';

Generating server-side data

from PDOStatement object

In the static method create pass the PDOStatement object then call the build object method to execute and return the output

use emagombe\DataTable;

$sql = "SELECT * FROM table;";
$stmt = $conn->prepare($sql);

$dt = DataTable::create($stmt)->build();
echo $dt; 

from Array

Same as above, pass a array to the static method create then call the build object method to execute and return the output

use emagombe\DataTable;

$array = [];
$dt = DataTable::create($array)->build();
echo $dt;

Streaming response

Use the stream method to print the response

DataTable::create($result)->stream();

Adding custom column

Call the object method addColumn to add a custom column. This method receives the current row as parameter;

Note: The callback should return a string containing the custom content of the column!

$dt = DataTable::create($result)->addColumn("action", function($row) {
	return "<b>".$row["name"]."</b>";
})->build();

addColumn params

order data type
first string
second method

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固