zhortein/datatable-bundle
最新稳定版本:v0.1.0-alpha.1
Composer 安装命令:
composer require zhortein/datatable-bundle
包简介
A Symfony 8+ bundle for Bootstrap-first business datatables driven by PHP definitions.
README 文档
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.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-11