Skip to content

Commit 8b38f4e

Browse files
Readme updated
1 parent 6902d91 commit 8b38f4e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# EloquentDataTable ![Build status](https://travis-ci.org/LiveControl/EloquentDataTable.svg?branch=master)
1+
# EloquentDataTable [![Build status](https://travis-ci.org/LiveControl/EloquentDataTable.svg?branch=master)](https://travis-ci.org/LiveControl/EloquentDataTable)
22
Eloquent compatible DataTable plugin for server side ajax call handling.
33

44
If you are familiar with eloquent and would like to use it in combination with [datatables](https://www.datatables.net/) this is what you are looking for.
@@ -24,10 +24,17 @@ var table = $('#example').DataTable({
2424
### Step 3: Use it
2525
```php
2626
$users = new Models\User();
27-
$dataTable = new \LiveControl\EloquentDataTable\DataTable($users, ['email', 'firstname', 'lastname']);
27+
$dataTable = new LiveControl\EloquentDataTable\DataTable($users, ['email', 'firstname', 'lastname']);
2828
echo json_encode($dataTable->make());
2929
```
3030

31+
### Optional step 4: Set versions of DataTables plugin.
32+
Just initialize the DataTable object as you would normally and call the setVersionTransformer function as in the following example (for version 1.09 of DataTables):
33+
```php
34+
$dataTable->setVersionTransformer(new LiveControl\EloquentDataTable\VersionTransformers\Version109Transformer());
35+
```
36+
By default the plugin will be loading the transformer which is compatible with DataTables version 1.10.
37+
3138
## Examples
3239

3340
- [Basic setup](#basic-example)

0 commit comments

Comments
 (0)