Download the PHP package ozdemir/datatables without Composer
On this page you can find all versions of the php package ozdemir/datatables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ozdemir/datatables
More information about ozdemir/datatables
Files in ozdemir/datatables
Package datatables
Short Description Simplify your Datatables server-side processing effortlessly using our lightning-fast PHP library, streamlining your workflow seamlessly.
License MIT
Informations about the package datatables
Datatables library for PHP
Simplify your Datatables server-side processing effortlessly using our lightning-fast PHP library, streamlining your workflow seamlessly. Live Demo
Features
- Easy to use. Generates json using only a few lines of code.
- Editable columns with a closure function.
- Supports custom filters.
- Can handle most complicated queries.
- Supports mysql and sqlite for native php.
- Works with :
Installation
NOTE: version 2.0+ requires php 7.1.3+ (php supported versions)
The recommended way to install the library is with Composer
If you haven't started using composer, I highly recommend you to use it.
Put a file named composer.json
at the root of your project, containing this information:
{
"require": {
"ozdemir/datatables": "2.*"
}
}
And then run:
Or just run :
Add the autoloader to your project:
You're now ready to begin using the Datatables php library.
If you are using a php framework such as codeigniter or laravel, you can use the relevant database adapter.
Methods
This is the list of available public methods.
query($query) required
- sets the sql query
generate() required
- runs the queries and build outputs
- returns the output as json
- same as generate()->toJson()
toJson()
- returns the output as json
- should be called after generate()
toArray()
- returns the output as array
- should be called after generate()
add($column, function( $row ){})
- adds extra columns for custom usage
edit($column, function($row){})
- allows column editing
filter($column, function(){})
- allows custom filtering
- it has the methods below
- escape($value)
- searchValue()
- defaultFilter()
- between($low, $high)
- whereIn($array)
- greaterThan($value)
- lessThan($value)
hide($columns)
- removes the column from output
- It is useful when you only need to use the data in add() or edit() methods.
setDistinctResponseFrom($column)
- executes the query with the given column name and adds the returned data to the output with the distinctData key.
setDistinctResponse($output)
- adds the given data to the output with the distinctData key.
getColumns()
- returns column names (for dev purpose)
getQuery()
- returns the sql query string that is created by the library (for dev purpose)
Example
Road Map
- better test suites for each class
- improve integrations for php frameworks
Requirements
Composer
DataTables > 1.10
PHP > 7.1.3
License
Copyright (c) 2015 Yusuf ÖZDEMİR, released under the MIT license