PHPackages                             devhelp/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. devhelp/datatables-bundle

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

devhelp/datatables-bundle
=========================

Datatables support for Symfony 2

233[2 issues](https://github.com/devhelp/DatatablesBundle/issues)JavaScript

Since Aug 25Pushed 10y ago3 watchersCompare

[ Source](https://github.com/devhelp/DatatablesBundle)[ Packagist](https://packagist.org/packages/devhelp/datatables-bundle)[ RSS](/packages/devhelp-datatables-bundle/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#DatatablesBundle [![Build Status](https://camo.githubusercontent.com/10c74e0ccd6fee891065ccd94664b3615f8f24ff38dddf0e1bd68a236d54403a/68747470733a2f2f7472617669732d63692e6f72672f64657668656c702f446174617461626c657342756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/devhelp/DatatablesBundle)

[![SensioLabsInsight](https://camo.githubusercontent.com/d0860a1ae49b538149074db274106684c6b4eecce3d479383b040607f7272180/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62633932333764612d363938612d343137662d386536392d6162313162363166363831312f6269672e706e67)](https://insight.sensiolabs.com/projects/bc9237da-698a-417f-8e69-ab11b61f6811)

This bundle provides a simple integration of [Datatables](http://datatables.net/).

\##Installation using composer.json

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

```
    php app/console assetic:dump

```

\##Configuration

\###Create configuration

\#####config.yml

```
    assetic:
        ...
        bundles:        [ DevhelpDatatablesBundle ]
        ...
```

\#####Minimal configuration #####config.yml

```
    devhelp_datatables:
        default_per_page: 10
        grids:
            product_grid:
                model: Devhelp\DemoBundle\Entity\Product
                routing: get_grid
                colum   ns:
                    - { title: 'ID',          data: 'id',            alias : 'p.id' }
                    - { title: 'Name',        data: 'name',          alias : 'p.name' }
                    - { title: 'Description', data: 'description',   alias : 'p.description' }
                    - { title: 'Price',       data: 'price',         alias : 'p.price' }
                    - { title: 'Category',    data: 'category.name', alias : 'c.name'}
```

\#####Full configuration #####config.yml

```
    devhelp_datatables:
        default_per_page: 10
        grids:
            product_grid:
                model: Devhelp\DemoBundle\Entity\Product
                routing: get_grid
                use_filters: true
                default_per_page: 10
                columns:
                    - { title: 'ID',          data: 'id',            alias : 'p.id',          searchable: 1, visible: 1, width: "10%" }
                    - { title: 'Name',        data: 'name',          alias : 'p.name',        searchable: 1, visible: 1, width: "30%" }
                    - { title: 'Description', data: 'description',   alias : 'p.description', searchable: 0, visible: 1, width: "10%" }
                    - { title: 'Price',       data: 'price',         alias : 'p.price',       searchable: 1, visible: 1, width: "10%" }
                    - { title: 'Category',    data: 'category.name', alias : 'c.name',        searchable: 1, visible: 1, width: "60%" }
```

\#####AppKernel.php

```
    $bundles = array(
        ...
        new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
        new JMS\SerializerBundle\JMSSerializerBundle(),
        new Devhelp\DatatablesBundle\DevhelpDatatablesBundle(),
        ...
    )
```

\###Create entities and repository class

\#####Product.php

```
    namespace Devhelp\DemoBundle\Entity;

    use Doctrine\ORM\Mapping as ORM;

    /**
     * @ORM\Entity(repositoryClass="Devhelp\DemoBundle\Entity\ProductRepository")
     * @ORM\Table(name="product")
     *
     */
    class Product
    {
        /**
         * @ORM\Column(type="integer")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        protected $id;

        /**
         * @ORM\Column(type="string", length=100)
         */
        protected $name;

        /**
         * @ORM\Column(type="decimal", scale=2)
         */
        protected $price;

        /**
         * @ORM\Column(type="text")
         */
        protected $description;

        /**
         * @ORM\ManyToOne(targetEntity="Category")
         * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
         */
        protected $category;
    }
```

\#####Category.php

```
    namespace Devhelp\DemoBundle\Entity;

    use Doctrine\ORM\Mapping as ORM;

    /**
     * @ORM\Entity
     * @ORM\Table(name="category")
     */
    class Category
    {
        /**
         * @ORM\Column(type="integer")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        protected $id;

        /**
         * @ORM\Column(type="string", length=100)
         */
        protected $name;

    }
```

\#####ProductRepository.php

```
    namespace Devhelp\DemoBundle\Entity;

    use Devhelp\DatatablesBundle\Lib\AbstractDatatablesRepository;

    class ProductRepository extends AbstractDatatablesRepository
    {

        public function getBaseQuery()
        {
            return $this->createQueryBuilder('p')->leftJoin('p.category','c');
        }

    }
```

\##Usage #####Controller

```
    /**
    *
    * @Route("/grid", name="product_grid")
    */
    public function indexAction()
    {
        $grid = $this->get('devhelp.datatables');
        $grid->load('product_grid');

        $jsonResult =  $grid->getResult();
        return new Response($jsonResult);
    }
```

\#####View

```
    {{ render_datatables_grid('product_grid') }}
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1479355?v=4)[devhelp](/maintainers/devhelp)[@devhelp](https://github.com/devhelp)

---

Top Contributors

[![michalsikora](https://avatars.githubusercontent.com/u/1239789?v=4)](https://github.com/michalsikora "michalsikora (60 commits)")[![michal-sikora](https://avatars.githubusercontent.com/u/1242064?v=4)](https://github.com/michal-sikora "michal-sikora (1 commits)")

### Embed Badge

![Health badge](/badges/devhelp-datatables-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/devhelp-datatables-bundle/health.svg)](https://phpackages.com/packages/devhelp-datatables-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
