rougin / datatables
PHP wrapper for Datatables' server-side.
dev-master / 1.0.x-dev
2020-10-06 01:26 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- doctrine/orm: ~2.4
- illuminate/database: >=4.1
- phpunit/phpunit: ~4.2|~5.7
- scrutinizer/ocular: ~1.1
This package is auto-updated.
Last update: 2024-11-06 10:28:19 UTC
README
Datatables is a package that uses Doctrine or Eloquent to generate a server-side AJAX result to a Datatable instance with little to no configuration.
Installation
Install Datatables
via Composer:
$ composer require rougin/datatables
Basic Usage
Doctrine
use Rougin\Datatables\DoctrineBuilder; $entity = 'Acme\Doctrine\Models\User'; $builder = new DoctrineBuilder($manager, $entity, $_GET); header('Content-Type: application/json'); echo json_encode($builder->make());
NOTE: $manager
must return an instance of Doctrine\ORM\EntityManager
. See DoctrineBuilderTest::setUp for the sample implementation.
Eloquent
use Rougin\Datatables\EloquentBuilder; $model = 'Acme\Eloquent\Models\UserModel'; $builder = new EloquentBuilder($model, $_GET); header('Content-Type: application/json'); echo json_encode($builder->make());
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Credits
License
The MIT License (MIT). Please see LICENSE for more information.