You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bundle provides convenient integration of the popular [DataTables](https://datatables.net/) jQuery library
12
-
for realtime AJAX tables in your Symfony 3.3+ or 4.0+ application. Older versions of Symfony [will not be supported](https://github.com/omines/datatables-bundle/issues/1).
12
+
for realtime Ajax tables in your Symfony 3.3+ or 4.0+ application.
13
13
14
14
Unlike other bundles providing similar functionality we decoupled the implementation of the DataTables logic
15
15
completely from the source of the data. Therefore it is possible to implement your own custom adapters for
16
16
every possible data source. Doctrine ORM comes bundled already, we intend to provide popular choices like
17
17
Elastica, Doctrine DBAL and MongoDB out of the box as well.
18
18
19
-
## Installation
19
+
## Documentation
20
20
21
-
To install, use composer:
21
+
[Visit the documentation with extensive code samples](https://omines.github.io/datatables-bundle/).
22
22
23
-
```bash
24
-
$ composer require omines/datatables-bundle
25
-
```
26
-
Then add the bundle to your kernel's bundle registration:
27
-
```php
28
-
public function registerBundles()
29
-
{
30
-
...
31
-
new \Omines\DataTablesBundle\DataTablesBundle(),
32
-
...
33
-
}
34
-
```
35
-
36
-
## Usage
37
-
38
-
To render the most basic table with predefined data, implement a controller like this:
Global configuration of the bundle is done in your config file. The default configuration is shown here,
149
+
and should be fine in most cases. Most settings can be overridden per table, but for most applications
150
+
you will want to make changes at the global level so they are applied everywhere, providing a uniform
151
+
look and feel.
152
+
153
+
The following settings only exist at the configuration level:
154
+
155
+
Option | Type | Description
156
+
------ | ---- | ------- | -----------
157
+
template | string | Default template to be used for rendering the basic HTML table in your templates.
158
+
renderer | string | Service used to render the table HTML, which must implement the <code>DataTableRendererInterface</code>.
159
+
160
+
The other settings correspond to table level settings, and the `options` are passed (almost) verbatim
161
+
to the DataTables clientside constructor. Refer to the sections below for details on individual settings
162
+
and options.
163
+
164
+
## Settings
165
+
166
+
These settings can all be defined both at the global config level and overridden per table.
167
+
168
+
Setting | Type | Default | Description
169
+
------- | ---- | ------- | -----------
170
+
name | string | dt | The name of the DataTable. Used mainly to separate callbacks in case multiple tables are used on the same page.
171
+
method | string | POST | Use `GET` or `POST` to define the HTTP method used by callbacks.
172
+
class_name | string | | Class to apply to the `<table>` element in generated tables. Separate multiple classes with a space.
173
+
column_filter | string | *null* | When using column level filters set this to `thead`, `tfoot` or `both` to specify where to render them.
174
+
language_from_cdn | bool | true | Either loads DataTables' own translations from CDN (default) or have them provided by your own Symfony translation files.
175
+
translation_domain | string | messages | Default translation domain used in the table structure.
0 commit comments