zhortein / datatable-bundle
A Symfony 8+ bundle for Bootstrap-first business datatables driven by PHP definitions.
Package info
github.com/Zhortein/datatable-bundle
Type:symfony-bundle
pkg:composer/zhortein/datatable-bundle
Requires
- php: >=8.4
- symfony/config: ^8.0
- symfony/dependency-injection: ^8.0
- symfony/http-foundation: ^8.0
- symfony/http-kernel: ^8.0
- symfony/routing: ^8.0
- symfony/security-core: ^8.0
- symfony/security-csrf: ^8.0
- symfony/translation: ^8.0
- symfony/twig-bundle: ^8.0
- symfony/yaml: ^8.0
- twig/twig: ^3.21
Requires (Dev)
- doctrine/doctrine-bundle: ^3.2
- doctrine/orm: ^3.4.4 || ^4.0
- friendsofphp/php-cs-fixer: ^3.95
- friendsoftwig/twigcs: ^6.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-doctrine: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^12.0
- symfony/doctrine-bridge: ^8.0
- symfony/event-dispatcher-contracts: ^3.6
- symfony/framework-bundle: ^8.0
- symfony/translation-contracts: ^3.6
- symfony/var-dumper: ^8.0
Suggests
- ext-intl: Recommended for locale-aware datetime formatting through IntlDateFormatter.
- doctrine/doctrine-bundle: Required to use Doctrine ORM backed datatables in Symfony applications.
- doctrine/orm: Required to use Doctrine ORM backed datatables.
- symfony/asset-mapper: Recommended to expose the provided Stimulus controller with Symfony AssetMapper.
- symfony/stimulus-bundle: Recommended to integrate the provided vanilla Stimulus controller.
- dev-main
- v0.1.0-alpha.1
- dev-develop
- dev-fix/335-xlsx-export-filename
- dev-docs/326-roadmap-after-xlsx-export
- dev-docs/325-xlsx-export-performance
- dev-docs/324-xlsx-export-strategy-usage
- dev-test/323-stimulus-xlsx-export-url
- dev-feature/322-xlsx-export-controls
- dev-feature/321-optional-xlsx-export-writer
- dev-feature/320-xlsx-export-format
- dev-docs/319-xlsx-export-strategy
- dev-docs/310-advanced-doctrine-capabilities
- dev-docs/309-doctrine-performance-guidance
- dev-test/308-doctrine-count-distinct-strategy
- dev-feature/307-doctrine-aggregate-columns
- dev-feature/306-safe-custom-doctrine-joins
- dev-feature/305-explicitly-chained-doctrine-joins
- dev-refactor/304-doctrine-field-metadata-resolver
- dev-refactor/303-doctrine-provider-query-building
- dev-docs/292-frontend-test-strategy
- dev-ci/291-run-frontend-tests
- dev-test/290-stimulus-confirmation
- dev-test/289-stimulus-export-url
- dev-test/288-stimulus-column-visibility
- dev-test/287-stimulus-sort-pagination
- dev-test/286-stimulus-search-filters-pagesize
- dev-test/285-stimulus-ajax-fragments
- dev-test/284-stimulus-connect-autoload
- dev-feature/283-frontend-test-tooling
- dev-feature/280-column-header-filter-dropdowns
- dev-feature/279-filter-layout-option
- dev-docs/270-ui-ux-rendering-customization
- dev-docs/269-column-header-filter-dropdowns
- dev-feature/268-additional-css-classes
- dev-feature/267-control-layout
- dev-feature/266-sortable-header-polish
- dev-feature/265-boolean-cell-display-modes
- dev-feature/264-action-display-modes
- dev-feature/263-action-icon-rendering-options
This package is auto-updated.
Last update: 2026-05-14 16:29:04 UTC
README
A Symfony 8+ bundle for Bootstrap-first business datatables driven by PHP definitions.
Status
Early development. Not production-ready.
Goals
- PHP-first datatable definitions.
- PHP attributes.
- Bootstrap-first rendering.
- Twig templates.
- Stimulus Ajax refresh.
- Vanilla JavaScript.
- Doctrine ORM provider.
- Declarative actions.
- Native Symfony translations.
- Extensible provider architecture.
Requirements
- PHP 8.4+
- Symfony 8+
- Composer 2+
Doctrine ORM is optional at package level, but required for Doctrine-backed datatables.
Installation
Installation instructions are documented in docs/installation.md.
Basic usage
Basic usage is documented in docs/basic-usage.md.
Expected direction:
<?php declare(strict_types=1); namespace App\Datatable; use App\Entity\User; use Zhortein\DatatableBundle\Attribute\AsDatatable; use Zhortein\DatatableBundle\Contract\DatatableInterface; use Zhortein\DatatableBundle\Definition\DatatableDefinition; use Zhortein\DatatableBundle\Enum\FilterOperator; #[AsDatatable(name: 'users')] final class UserDatatable implements DatatableInterface { public function buildDatatable(DatatableDefinition $definition): void { $definition ->setEntityClass(User::class) ->setTranslationDomain('user') ->addColumn('e.id', visible: false, sortable: false, searchable: false) ->addColumn('e.email') ->addColumn('e.displayName') ->addColumn('e.createdAt', searchable: false) ->addPermanentFilter('e.deletedAt', FilterOperator::IsNull) ; } }
Expected Twig usage:
{{ zhortein_datatable('users') }}
With runtime options:
{{ zhortein_datatable('users', {
search: true
}) }}
Examples
Documentation
- Documentation index
- Installation
- Basic usage
- Configuration
- Development workflow
- CI matrix and dependency strategy
- Release workflow
- First pre-release checklist
- Fresh Symfony smoke test plan
- Packagist readiness
- Features
- Architecture
- Documentation review checklist
- Roadmap
- First end-to-end flow
- Doctrine-backed datatables
- Actions and typed cell rendering
- Routes
- Stimulus and AssetMapper integration
- Table controls and interactions
- Column visibility and preferences
- User-facing filters
- Server-side exports
- Twig templates and overrides
- Template context reference
- Optional icon rendering strategy
- Cell template reference
- Theming and rendering customization
- Action security and visibility
- Changelog strategy
- Public API review
Architecture decisions
- 0001 - Legacy code as functional reference only
- 0002 - Initial public datatable API
- 0003 - Bootstrap rendering strategy
- 0004 - Vanilla Stimulus interaction model
- 0005 - Doctrine ORM provider architecture
Development
composer install composer qa
With the local Docker tooling:
make installdeps make qa
Quality requirements
The project must pass:
- PHPUnit;
- PHPStan at maximum level;
- PHP-CS-Fixer with Symfony-oriented rules;
- twigcs when Twig templates are present;
- GitHub Actions CI.
License
This bundle is released under the MIT License.