Download the PHP package ropendev/datatablesphp without Composer
On this page you can find all versions of the php package ropendev/datatablesphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ropendev/datatablesphp
More information about ropendev/datatablesphp
Files in ropendev/datatablesphp
Package datatablesphp
Short Description PHP DataTables wrapper class for DataTables.js (Html and/or Javascript generation, Server-Side SQL) .
License MIT
Homepage http://www.robin-d.fr/DataTablesPHP/
Informations about the package datatablesphp
DataTablesPHP : PHP class to easily use DataTables.js
Table of contents
- Description
- Features
- Installation
- Example
- Documentation
- License
- Todo
Description
DataTablesPHP generates easily your DataTable Html or Javascript... with Server-Side or not. It enhances the filters's utilisation adding individual column filtering (with or without server-side).
Compatible with the last version of DataTables (1.10.x).
Features
- Generate html table (complex header)
- Generate the Javascript related (Data can be set in the initial parameters or load via Ajax or Server-Sive)
- Custom search column by column and complex search to optimize SQL queries
- Analyze Server-Side Request and Generate SQL queries
- Can handle complex query (join)
- Can handle Optimize Query to search value (not only Like %, you can parameter to use =,<,>,<=,>=,BETWEEN...)
- Using all this features in the same time permits to easily handle a dataTable with PHP
Server-side part inspired from Allan Jardine's Class SSP. Improve in order to don't trust user input, add the join possibilities and more...
Installation
You can clone this git, download the class or use Composer :
Example
See in the examples
folder.
Documentation
A php array for a column can contain :
- Properties for Initialization Javascript (see
self::$columnParams
or http://datatables.net/reference/option/) parent
(=>$title
) : To have a complex header with a colspan... Set the same $title to put multiple column under the same thsFilter
(=>array
) : for the column filtering options (seeself::$columFilteringParams
)- SQL params (
sql_name
andsql_table
) : if there is different from data or default table set with setFrom alias
: sql alias (not required)formatter
(=>function($columnValue,$rowValues,$columnParams)
) : if you want to print your data with a special format, set a function In a Server-Side Request, if you don't want select a SQL column, just don't setsql_name
ordata
properties (but set aformatter
function to print something !).
License
MIT (see the LICENSE
file for details)
Todo
It will come soon :
- AutoGenerate select's options if there is data (l.469)
- Example with export function