Download the PHP package datatables.net/php without Composer
On this page you can find all versions of the php package datatables.net/php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download datatables.net/php
More information about datatables.net/php
Files in datatables.net/php
Package php
Short Description PHP server-side libraries for DataTables
License MIT
Homepage https://datatables.net
Informations about the package php
DataTables PHP server-side libraries
This is a PHP library to provide easy server-side support for DataTables - the Javascript table library.
These libraries provide support for:
- Server-side processing - work with millions of rows
- Editor - Editing UI for DataTables
- ColumnControl - Column search controls for DataTables
- SearchBuilder - Complex search logic UI
The library is framework-agnostic and can be used in any web framework, including Laravel, Symfony and CodeIgniter. It is dependency free, other than PHP core with PDO, and uses a database abstraction layer to operate with MySQL, Postgres, SQLite and SQLServer, using the same API.
Installation
Available on Packagist, this package can be installed with:
Then add:
to your files that use the DataTables classes. The required classes will be automatically included as you use them.
If you prefer not to use composer and include the PHP files directly, download them and require the DataTables.php file, which will load the auto loader for the classes:
Database connection
You must create a database connection using the Database class. This can be done automatically by defining the array $sql_details in config.php, or creating a new Database() class instance directly:
There are two primary entry point classes in the library:
DataTable- for read only tablesEditor- for read / write tables, with Editor
There are also a number of supporting classes such as Options, Mjoin and more.
Quick Start
Once a database connection is configured, you can use the library to read and write data on a database - e.g. the following is a simple PHP file that acts as a CRUD end point for for a DataTables / Editor client-side:
Note that the above uses PHP 8.4 syntax to chain a constructor without parentheses. If you are using an older version of PHP you can use either:
(new Editor($db, 'name'))->fields(...)Editor:inst($db, 'name')->fields(...)
Similarly, if your table is readonly, the DataTable and Column classes can be used (this will support DataTables' client-side or server-side processing modes):
Documentation
For full documentation, please refer to the DataTables site.
License
MIT — see LICENSE for full text.