survos/grid-bundle

The basics: render a plain in-memory or single-fetch table with Twig + Stimulus + DataTables.net (v3). No ApiPlatform required — see survos/api-grid-bundle for that.

Maintainers

Package info

github.com/survos/grid-bundle

Type:symfony-bundle

pkg:composer/survos/grid-bundle

Transparency log

Fund package maintenance!

kbond

Statistics

Installs: 1 874

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.18.18 2026-08-06 14:12 UTC

This package is auto-updated.

Last update: 2026-08-07 12:15:28 UTC


README

Use the DataTables.net javascript library with Symfony, Twig.

composer req survos/grid-bundle

Ideas

Import the datasets at https://domohelp.domo.com/hc/en-us/articles/360043931814-Fun-Sample-DataSets https://www.mytechylife.com/2015/09/29/next-and-previous-row-with-jquery-datatables/ https://github.com/lerocha/chinook-database http://2016.padjo.org/tutorials/sqlite-data-starterpacks/#more-info-simplefolks-for-simple-sql

Dev only...

composer config repositories.survos_grid_bundle '{"type": "vcs", "url": "git@github.com:survos/SurvosGridBundle.git"}'

symfony new grid-demo --webapp --version=next --php=8.2 && cd grid-demo
composer config extra.symfony.allow-contrib true
composer req symfony/asset-mapper symfony/stimulus-bundle:2.x-dev
composer req survos/grid-bundle survos/scraper-bundle

# make it prettier with bootstrap, but not necessary
bin/console importmap:require bootstrap
echo "import 'bootstrap/dist/css/bootstrap.min.css'" >> assets/app.js

bin/console make:controller grid -i
cat > templates/grid.html.twig <<END
{% extends 'base.html.twig' %}

{% block body %}
    {% set data = request_data('https://jsonplaceholder.typicode.com/users') %}
    <twig:grid :data="data" :columns="data[0]|keys">
        <twig:block name="id">
            {{ row.id }}
        </twig:block>
        <twig:block name="title">
            <i>{{ row.title }}</i>
        </twig:block>
    </twig:grid>
    </table>
{% endblock %}
END
symfony server:start -d
symfony open:local --path=/grid