Skip to content

UX DataTables

Powerful DataTables integration for Symfony applications

Features

Easy Integration

Seamlessly integrate DataTables with your Symfony application using the Stimulus controller provided by Symfony UX.

Fluent Builder API

Build your tables with an intuitive PHP API. Define columns, options, and extensions with method chaining.

Server-Side Processing

Handle large datasets efficiently with built-in server-side processing support and Doctrine integration.

Extensions Support

Use DataTables extensions like Buttons, Select, Responsive, and more with simple PHP configuration.

Quick Example

use Pentiminax\UX\DataTables\Builder\DataTableBuilderInterface;
use Pentiminax\UX\DataTables\Column\TextColumn;
class HomeController extends AbstractController
{
#[Route('/', name: 'app_homepage')]
public function index(DataTableBuilderInterface $builder): Response
{
$table = $builder
->createDataTable('usersTable')
->columns([
TextColumn::new('firstName', 'First name'),
TextColumn::new('lastName', 'Last name'),
])
->data([
['firstName' => 'John', 'lastName' => 'Doe'],
['firstName' => 'Jane', 'lastName' => 'Smith'],
]);
return $this->render('home/index.html.twig', [
'table' => $table,
]);
}
}

Then render in Twig:

{{ render_datatable(table) }}

Requirements

  • PHP 8.2 or higher
  • Symfony 6.4+ or 7.0+
  • Symfony StimulusBundle (Symfony UX)