pentiminax / ux-datatables
DataTables.net integration for Symfony
Package info
github.com/pentiminax/ux-datatables
Type:symfony-bundle
pkg:composer/pentiminax/ux-datatables
v0.38.1
2026-04-23 13:53 UTC
Requires
- php: >=8.3
- symfony/config: ^7.0 || ^8.0
- symfony/dependency-injection: ^7.0 || ^8.0
- symfony/http-kernel: ^7.0 || ^8.0
- symfony/property-access: ^7.0 || ^8.0
- symfony/security-bundle: ^7.0 || ^8.0
- symfony/stimulus-bundle: ^2.22
Requires (Dev)
- api-platform/core: ^3.0 || ^4.0
- doctrine/orm: ^3.0
- friendsofphp/php-cs-fixer: ^3.94
- phpunit/phpunit: ^11.5
- symfony/form: ^7.0 || ^8.0
- symfony/framework-bundle: ^7.0 || ^8.0
- symfony/maker-bundle: ^1.66
- symfony/mercure-bundle: ^0.4.2
- symfony/phpunit-bridge: ^7.0 || ^8.0
- symfony/property-info: ^7.0 || ^8.0
- symfony/translation: ^7.0 || ^8.0
- symfony/twig-bundle: ^7.0 || ^8.0
- symfony/var-dumper: ^7.0 || ^8.0
Suggests
- api-platform/core: To auto-detect columns from API Platform metadata.
- symfony/form: To enable inline edit modal with auto-generated forms.
- symfony/maker-bundle: To use the make:datatable command.
- symfony/mercure-bundle: To enable real-time DataTable updates via Mercure SSE.
- symfony/translation: To enable translation of DataTable column titles.
- symfony/twig-bundle: To render edit form and TwigColumn
Conflicts
- symfony/flex: <1.13
- dev-main
- 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
- dev-dependabot/npm_and_yarn/docs/astro-6.1.8
This package is auto-updated.
Last update: 2026-04-23 13:54:29 UTC
README
UX DataTables is a Symfony bundle integrating the DataTables library in Symfony applications.
Requirements
- PHP 8.3 or higher
- Symfony StimulusBundle (installed through Symfony UX)
- Composer
Installation
Install the library via Composer:
composer require pentiminax/ux-datatables
Usage
1. Declare a DataTable
use App\Entity\User; use Pentiminax\UX\DataTables\Attribute\AsDataTable; use Pentiminax\UX\DataTables\Column\BooleanColumn; 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'), ]; } }
Column variants are configured fluently after new():
TextColumn::new('name')->utf8(); TextColumn::new('content')->html()->utf8(); NumberColumn::new('price')->formatted(); BooleanColumn::new('active')->renderAsSwitch();
2. Wire it in a controller
#[Route('/users', name: 'app_users')] public function index(UserDataTable $table, Request $request): Response { $table->handleRequest($request); if ($table->isRequestHandled()) { return $table->getResponse(); } return $this->render('user/index.html.twig', [ 'table' => $table->getDataTable(), ]); }
3. Render in Twig
{{ render_datatable(table) }}
Tip: run
php bin/console make:datatableto scaffold a DataTable class from any Doctrine entity.