PHPackages                             riculum/php-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. riculum/php-datatables

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

riculum/php-datatables
======================

Simple PHP extension for Datatables

v2.0.0(3y ago)08MITPHP

Since Apr 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Riculum/PHP-Datatables)[ Packagist](https://packagist.org/packages/riculum/php-datatables)[ RSS](/packages/riculum-php-datatables/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

PHP-Datatables
==============

[](#php-datatables)

Simple PHP extension for [Datatables](http://datatables.net)

Installation
------------

[](#installation)

Use the package manager [composer](https://getcomposer.org) to install the library

```
composer require riculum/php-datatables
```

Initial setup
-------------

[](#initial-setup)

### Credentials

[](#credentials)

The basic database settings can be set through environment variables. Add a `.env` file in the root of your project. Make sure the `.env` file is added to your `.gitignore` so it is not checked-in the code. By default, the library looks for the following variables:

- DB\_HOST
- DB\_NAME
- DB\_USERNAME
- DB\_PASSWORD

More information how to use environment variables [here](https://github.com/vlucas/phpdotenv)

### Configuration

[](#configuration)

Import vendor/autoload.php and load the `.env` settings

```
require_once 'vendor/autoload.php';

use Database\Core\Database as DB;

$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
```

Datatables
----------

[](#datatables)

### BASIC

[](#basic)

To get the properly formatted data, you just need to define the table and columns

```
$table = "user";
$columns = ["id", "firstname", "lastname", "company", "address", "city", "email", "phone"];

echo Datatable::getDatatable($table, $columns);
```

### JOIN

[](#join)

To combine multiple tables with related columns, use the SQL `JOIN` statement

```
$table = "user JOIN city ON user.zip = city.zip";
$columns = ["user.id", "firstname", "lastname", "company", "address", "city.name", "email", "phone"];

echo Datatable::getDatatable($table, $columns);
```

Notice to specify the columns with table names

### WHERE

[](#where)

Use the `WHERE` clause to extract with priority only those records that meet a certain condition

```
$table = "user";
$columns = ["id", "firstname", "lastname", "company", "address", "city", "email", "phone"];

$where =     [
    'key' => 'id',
    'operator' => '=',
    'value' => 1
];

echo Datatable::getDatatable($table, $columns, $where);
```

Bugreport &amp; Contribution
----------------------------

[](#bugreport--contribution)

If you find a bug, please either create a ticket in github, or initiate a pull request

Versioning
----------

[](#versioning)

We adhere to semantic (major.minor.patch) versioning (). This means that:

- Patch (x.x.patch) versions fix bugs
- Minor (x.minor.x) versions introduce new, backwards compatible features or improve existing code.
- Major (major.x.x) versions introduce radical changes which are not backwards compatible.

In your automation or procedure you can always safely update patch &amp; minor versions without the risk of your application failing.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~36 days

Total

2

Last Release

1458d ago

Major Versions

v1.0.0 → v2.0.02022-05-21

### Community

Maintainers

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

---

Top Contributors

[![riculum](https://avatars.githubusercontent.com/u/88209361?v=4)](https://github.com/riculum "riculum (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/riculum-php-datatables/health.svg)

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

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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