PHPackages                             umer936/cakephp-datatables - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. umer936/cakephp-datatables

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

umer936/cakephp-datatables
==========================

DataTables for CakePHP 5.3 without jQuery

v5.3.1(4mo ago)0469[1 issues](https://github.com/umer936/cakephp-datatables/issues)MITPHPPHP &gt;=8.1

Since Feb 8Pushed 4mo agoCompare

[ Source](https://github.com/umer936/cakephp-datatables)[ Packagist](https://packagist.org/packages/umer936/cakephp-datatables)[ Docs](https://github.com/umer936/cakephp-datatables)[ RSS](/packages/umer936-cakephp-datatables/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (1)Versions (16)Used By (0)

cakephp-datatables
==================

[](#cakephp-datatables)

[DataTables](https://www.datatables.net) is a JavaScript library for intelligent HTML tables. Next to adding dynamic elements to the table, it also has great support for on-demand data fetching and server-side processing. DataTables 2 can run without jQuery, and this plugin now targets that vanilla API. The *cakephp-datatables* plugin makes it easy to use the functionality DataTables provides in your CakePHP application. It consists of a helper to add DataTables to your view and a Component to transparently process AJAX requests made by DataTables.

Versioning
----------

[](#versioning)

- Versions 4.x are for users of CakePHP 4.0 and above
- Versions 3.x are for users of CakePHP 3.6 and above
- Versions 2.x are available for older CakePHP installations, but will not receive new features
- Version 1.0 is a tag available for people who let their code rot. Consider upgrading by only changing a couple of lines!
- Branch `php5` is for people without PHP 7 and currently stuck at version 1.0

Requirements
------------

[](#requirements)

- PHP 8.1+
- CakePHP 5.3+
- DataTables 1.x or 2.x

Installation and Usage
----------------------

[](#installation-and-usage)

Please see the [Documentation](https://github.com/ypnos-web/cakephp-datatables/wiki), esp. the [Quick Start tutorial](https://github.com/ypnos-web/cakephp-datatables/wiki/Quick-Start)

Virtual fields / computed columns
---------------------------------

[](#virtual-fields--computed-columns)

DataTables can request sorting or searching on columns that are not physical database fields (for example a computed `full_name` or `price_total`).

In this case, delegate filtering and ordering to a custom finder:

```
// In your controller
$data = $this->DataTables->find(
	'Users',
	'datatables',
	[
		'delegateSearch' => true,
		'delegateOrder' => true,
	],
	$columns
);
```

```
// In src/Model/Table/UsersTable.php
use Cake\ORM\Query\SelectQuery;

public function findDatatables(SelectQuery $query, array $options): SelectQuery
{
	$search = $options['globalSearch'] ?? '';
	$requestedOrder = $options['customOrder'] ?? [];

	if ($search !== '') {
		$search = '%' . $search . '%';
		$query->where([
			'OR' => [
				'Users.first_name LIKE' => $search,
				'Users.last_name LIKE' => $search,
			],
		]);
	}

	// Allowlist requested sort keys and map virtual fields to SQL expressions.
	$safeOrder = [];
	foreach ($requestedOrder as $field => $dir) {
		$dir = strtoupper((string)$dir) === 'DESC' ? 'DESC' : 'ASC';

		if ($field === 'full_name') {
			$safeOrder[$query->newExpr("Users.first_name || ' ' || Users.last_name")] = $dir;
			continue;
		}

		if (in_array($field, ['Users.id', 'Users.created'], true)) {
			$safeOrder[$field] = $dir;
		}
	}

	if ($safeOrder) {
		$query->orderBy($safeOrder);
	}

	return $query;
}
```

Use this pattern whenever a DataTables column cannot be mapped directly to a real table column.

Credits
-------

[](#credits)

This work is based on the [code by Frank Heider](https://github.com/fheider/cakephp-datatables) and incorporates [code by Xavier Zolezzi](https://github.com/x-zolezzi/cakephp-datatables).

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance74

Regular maintenance activity

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 73.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~265 days

Recently: every ~132 days

Total

12

Last Release

148d ago

Major Versions

v1.0 → 2.x-dev2018-04-23

v2.1 → v3.02018-05-16

3.x-dev → 4.x-dev2020-06-08

4.x-dev → v5.02024-08-27

PHP version history (2 changes)v2.0PHP &gt;=7.0

v5.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9259edd639d2ec8a239cab88c0604b70a5fcaf13c8f2250f1ff080ed6514456?d=identicon)[umer936](/maintainers/umer936)

---

Top Contributors

[![ypnos](https://avatars.githubusercontent.com/u/8481470?v=4)](https://github.com/ypnos "ypnos (102 commits)")[![umer936](https://avatars.githubusercontent.com/u/2078163?v=4)](https://github.com/umer936 "umer936 (13 commits)")[![asaliev](https://avatars.githubusercontent.com/u/836841?v=4)](https://github.com/asaliev "asaliev (10 commits)")[![ypnos-web](https://avatars.githubusercontent.com/u/15981753?v=4)](https://github.com/ypnos-web "ypnos-web (10 commits)")[![ThomasNucleus](https://avatars.githubusercontent.com/u/25164792?v=4)](https://github.com/ThomasNucleus "ThomasNucleus (2 commits)")[![gildonei](https://avatars.githubusercontent.com/u/1370979?v=4)](https://github.com/gildonei "gildonei (1 commits)")

---

Tags

cakephpdatatables

### Embed Badge

![Health badge](/badges/umer936-cakephp-datatables/health.svg)

```
[![Health](https://phpackages.com/badges/umer936-cakephp-datatables/health.svg)](https://phpackages.com/packages/umer936-cakephp-datatables)
```

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

3361.0M51](/packages/dereuromark-cakephp-tools)[cakephp/bake

Bake plugin for CakePHP

11212.0M202](/packages/cakephp-bake)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308954.9k25](/packages/dereuromark-cakephp-queue)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1882.3M44](/packages/dereuromark-cakephp-ide-helper)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

3099.1k6](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

131240.2k13](/packages/dereuromark-cakephp-tinyauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
