For Symfony Flex installation you need to enable community recipes:
composer config extra.symfony.allow-contrib true
Install
composer require aziz403/ux-datatable
Enable the bundle in the kernel (not needed with symfony flex):
<?php
// config/bundles.php
return [
// ...
Aziz403\UX\Datatable\DatatableBundle::class => ['all' => true],
];
And add your global datatable configuration in
datatable:
# Load i18n data from DataTables CDN or locally
language_from_cdn: true
# Language of the Datatables (if language_from_cdn true)
language: 'en'
# Default options to load into DataTables
# options:
# stateSave: true
# Default parameters to be passed to the template
template_parameters:
# Default Datatables style (one from none,bootstrap3,bootstrap4,bootstrap5,foundation,bulma,jqueryui)
style: 'bootstrap5'
# Default class attribute to apply to the root table elements (change it to be compatible with the style)
className: 'table table-striped'
See Docs for more about configuration.