pentiminax / ux-datatables
DataTables.net integration for Symfony
Package info
github.com/pentiminax/ux-datatables
Type:symfony-bundle
pkg:composer/pentiminax/ux-datatables
Requires
- php: >=8.2
- symfony/config: ^7.0 || ^8.0
- symfony/dependency-injection: ^7.0 || ^8.0
- symfony/deprecation-contracts: ^2.5 || ^3.0
- symfony/http-kernel: ^7.0 || ^8.0
- symfony/property-access: ^7.0 || ^8.0
- symfony/security-bundle: ^7.0 || ^8.0
- symfony/security-csrf: ^7.0 || ^8.0
- symfony/serializer: ^7.0 || ^8.0
- symfony/stimulus-bundle: ^2.0 || ^3.0
Requires (Dev)
- api-platform/core: ^3.0 || ^4.0 || ^5.0
- doctrine/orm: ^3.3
- friendsofphp/php-cs-fixer: ^3.95
- openspout/openspout: ^4.13
- phpunit/phpunit: ^11.5 || ^12.0 || ^13.4
- symfony/asset: ^7.0 || ^8.0
- symfony/asset-mapper: ^7.4 || ^8.0
- symfony/browser-kit: ^7.0 || ^8.0
- symfony/css-selector: ^7.0 || ^8.0
- symfony/dom-crawler: ^7.0 || ^8.0
- symfony/expression-language: ^7.0 || ^8.0
- symfony/form: ^7.4 || ^8.0
- symfony/framework-bundle: ^7.4 || ^8.0
- symfony/maker-bundle: ^1.66
- symfony/mercure-bundle: ^0.7.0
- symfony/phpunit-bridge: ^7.0 || ^8.0
- symfony/property-info: ^7.0 || ^8.0
- symfony/translation: ^7.0 || ^8.0
- symfony/twig-bundle: ^7.4 || ^8.0
- symfony/var-dumper: ^7.0 || ^8.0
- symfony/web-profiler-bundle: ^7.4 || ^8.0
Suggests
- api-platform/core: To auto-detect columns from API Platform metadata.
- doctrine/orm: To serve Doctrine-backed tables and use the query contracts.
- openspout/openspout: To enable server-side CSV and XLSX export.
- symfony/browser-kit: To test your tables with DataTableTestCase.
- symfony/css-selector: To locate a rendered table in tests.
- symfony/dom-crawler: To assert on client-side tables in tests.
- symfony/expression-language: To use expressions with permission().
- symfony/form: To enable the inline edit modal.
- symfony/maker-bundle: To use the make:datatable command.
- symfony/mercure-bundle: To enable real-time updates via Mercure.
- symfony/translation: To translate column titles and filter bar labels.
- symfony/twig-bundle: To render the edit form and TwigColumn.
Provides
None
Conflicts
- symfony/flex: <1.13
Replaces
None
- 2.x-dev
- 1.x-dev
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
- v0.90.0
- v0.89.0
- v0.88.0
- v0.87.0
- v0.86.0
- v0.85.0
- v0.84.0
- v0.83.0
- v0.82.0
- v0.81.0
- v0.80.0
- v0.79.0
- v0.78.0
- v0.77.0
- v0.76.0
- v0.75.0
- v0.74.0
- v0.73.0
- v0.72.0
- v0.71.0
- v0.70.0
- v0.69.1
- v0.69.0
- v0.68.2
- v0.68.1
- v0.68.0
- v0.67.0
- v0.66.0
- v0.65.0
- v0.64.0
- v0.63.0
- v0.62.0
- v0.61.0
- v0.60.0
- v0.59.0
- v0.58.0
- v0.57.0
- v0.56.1
- v0.56.0
- v0.55.1
- v0.55.0
- v0.54.1
- v0.54.0
- v0.53.0
- v0.52.0
- v0.51.0
- v0.50.0
- v0.49.0
- v0.48.0
- v0.47.0
- v0.46.0
- v0.45.0
- v0.44.0
- v0.43.0
- v0.42.0
- v0.41.0
- v0.40.0
- v0.39.0
- v0.38.1
- v0.38.0
- v0.37.0
- v0.36.0
- v0.35.0
- v0.34.0
- v0.33.2
- v0.33.1
- v0.33.0
- v0.32.1
- v0.32.0
- v0.31.2
- v0.31.1
- v0.31.0
- v0.30.1
- v0.30.0
- v0.29.1
- v0.29.0
- v0.28.0
- v0.27.1
- v0.27.0
- v0.26.1
- v0.26.0
- v0.25.0
- v0.24.0
- v0.23.0
- v0.21.2
- v0.21.1
- v0.21.0
- v0.20.0
- v0.19.0
- v0.18.2
- v0.18.1
- v0.18.0
- v0.17.4
- v0.17.3
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.0
- v0.15.6
- v0.15.5
- v0.15.4
- v0.15.3
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.1
- v0.14.0
- v0.13.5
- v0.13.4
- v0.13.3
- v0.13.2
- v0.13.1
- v0.13.0
- v0.12.3
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.0
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.0
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.1
- v0.1.0
This package is auto-updated.
Last update: 2026-11-24 20:33:39 UTC
README
The easiest way to build DataTables.net tables in Symfony
Documentation β’ Demo β’ Video Tutorial
UX DataTables is a Symfony UX bundle that turns a PHP class into a fully featured DataTables.net table: typed columns, Doctrine-backed server-side processing, filters, actions, inline editing, and live updates.
Quick Start
composer require pentiminax/ux-datatables php bin/console make:datatable
Declare the table:
use App\Entity\User; use Pentiminax\UX\DataTables\Attribute\AsDataTable; use Pentiminax\UX\DataTables\Column\DateColumn; use Pentiminax\UX\DataTables\Column\NumberColumn; use Pentiminax\UX\DataTables\Column\TextColumn; use Pentiminax\UX\DataTables\Model\AbstractDataTable; #[AsDataTable(User::class)] final class UserDataTable extends AbstractDataTable { public function configureColumns(): iterable { return [ NumberColumn::new('id', 'ID'), TextColumn::new('firstName', 'First name'), TextColumn::new('email', 'Email'), DateColumn::new('createdAt', 'Created at'), ]; } }
Pass it to your template:
#[Route('/users', name: 'app_users')] public function index(UserDataTable $table): Response { return $this->render('user/index.html.twig', ['table' => $table]); }
Render it in Twig:
{{ render_datatable(table) }}
That's it!
π Read the full documentation β
Features
| Feature | Description |
|---|---|
| β‘ Table in Minutes | Scaffold a table from any Doctrine entity with make:datatable |
| ποΈ Server-side Processing | Pagination, search, and ordering handled through Doctrine, in-memory arrays, or API Platform |
| ποΈ Typed Columns | Text, number, money, date, boolean, enum, and more, configured fluently |
| π Filters | Built-in filters and column controls to narrow down your data |
| βοΈ Actions | Row actions, bulk actions over selected rows, and detail rows |
| βοΈ Inline Editing | Edit rows in a modal or toggle booleans in place, with CSRF protection |
| π€ Exports | CSV and XLSX exports through the same query pipeline |
| π§© DataTables Extensions | Buttons, Select, Responsive, FixedHeader, RowGroup, SearchBuilder, and more, lazy-loaded |
| π‘ Live Updates | Optional Mercure integration to push changes to the table |
| π¨ Bootstrap & Modals | Style and modal adapters you can swap or extend |
| π Translatable | English and French catalogs included |
| β Testable | DataTableTestCase exercises your table through the same Ajax routes as the browser |
Requirements
- PHP 8.3 or higher
- Symfony 7.4 or 8.x
- Symfony StimulusBundle 2.x or 3.x
Security
The bundle registers Ajax routes under /datatables/ajax/* for data, edit, delete, detail, bulk
actions, and exports. The table token embedded in the page identifies which table is requested,
not who requests it. Protect these routes with your Symfony Security configuration:
# config/packages/security.yaml security: access_control: - { path: ^/datatables/ajax, roles: ROLE_ADMIN }
See Securing Ajax Routes for details.
Demo
A Symfony demo app in demo/ tours columns, filters, actions, exports, and extensions,
each page next to the code running it:
cd demo
composer install
php bin/console app:demo:reset
php -S 127.0.0.1:8000 -t public
Contributing
Contributions are welcome. Read the contribution guidelines, then open an issue to discuss your idea or send a pull request.
License
This bundle is released under the MIT License.