PHPackages                             wiechert/datatables-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wiechert/datatables-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

wiechert/datatables-bundle
==========================

Extension for easily generating datatables from Doctrine entities.

1151JavaScript

Since Sep 2Pushed 12y ago1 watchersCompare

[ Source](https://github.com/twiechert/WiechertDataTablesBundle)[ Packagist](https://packagist.org/packages/wiechert/datatables-bundle)[ RSS](/packages/wiechert-datatables-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

WiechertDataTablesBundle
========================

[](#wiechertdatatablesbundle)

This Symfony 2 Bundle can generate a [DataTable](https://datatables.net/ "DataTables Plugin") (the jQuery Plugin) from a Doctrine entity and handles the server-side progressing. The **WiechertDataTablesBundle** has further interesting features that are covered in the example section.

\#####DataTable generated for a position (of an order and its referenced entities): [![](https://camo.githubusercontent.com/4a5625c90acbd93b777eab06cdf59ca5b778793266d29b1606d46f2e13599dbe/687474703a2f2f7075626c69632e736f667477617265656e747769636b6c756e672d77696563686572742e64652f646f63756d656e746174696f6e2f446174617461626c65732f706f736974696f6e2d73657061726174696f6e2d6578706c696e6174696f6e2e706e67)](https://camo.githubusercontent.com/4a5625c90acbd93b777eab06cdf59ca5b778793266d29b1606d46f2e13599dbe/687474703a2f2f7075626c69632e736f667477617265656e747769636b6c756e672d77696563686572742e64652f646f63756d656e746174696f6e2f446174617461626c65732f706f736974696f6e2d73657061726174696f6e2d6578706c696e6174696f6e2e706e67)

Table of contents
=================

[](#table-of-contents)

- Core Features
- Installation
- Example
- Customize view
- Configuration Reference

Core Features
=============

[](#core-features)

- let the bundle generate DataTables for a given Doctrine entity and
- server-side searching, sorting, JSON serialization
- customizable views using exclusion strategies
- the EntityDisplayer creates a readable view for your entities and shows additional information using NamedDatatables

Installation
============

[](#installation)

\###1. Install via composer:

Add the bundle to your dependencies in the composer.json.

```
  "require": {
		...
		"wiechert/datatables-bundle": "dev-master",
		...
    },

```

Run the following command in a shell to install the **WiechertDataTablesBundle** and its dependencies:

```
php composer.phar update wiechert/datatables-bundle

```

\###2. Allow routing:

You have to allow the bundle's routing configuration. Add the following code to your routing.yml

```
wiechert_data_tables:
	resource: "@WiechertDataTablesBundle/Controller/"
    type:     annotation
    prefix:   /

fos_js_routing:
    resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"

```

Feel free to customize the prefix.

\###3. Allow Twig asset management:

The bundle uses asset manegment of Twig, which has to be allowed in your config.yml

```
assetic:
	...
    bundles:        [ WiechertDataTablesBundle ]

```

\###4. Update your AppKernel.php:

Make sure that your AppKernel.php registers the following bundles:

```
new JMS\SerializerBundle\JMSSerializerBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
new Wiechert\DataTablesBundle\WiechertDataTablesBundle(),

```

\###4. Configuration:

Please work trough the example section and create a configuration file applicable to your use case.

Example
=======

[](#example)

\###1. Annotate your entity classes:

There could be an entity class `Category` that points to a class `User` who is its creator. We use the default Doctrine annotations and additionally annotations called `DisplayName` and `Groups`.

\#####Annotating the category class:

```
