Type to search columns, filters, options, and extensions.

to navigate · Enter to open · Esc to close

Documentation

Attributes

Reference for AsDataTable and Column PHP attributes

#[AsDataTable]

Target: class

#[AsDataTable(User::class, serializationGroups: ['user:list'], mercure: true, apiPlatform: true)]
#[AsDataTable(
    entityClass: User::class,
    mercure: [
        'topics' => [
            'https://example.com/users',
        ],
    ],
)]

Arguments:

ArgumentTypeDefaultDescription
entityClassstringrequiredDoctrine entity class linked to the table
serializationGroupsstring[][]API Platform serialization groups used during column auto-detection (requires apiPlatform: true)
mercurebool|arrayfalseEnable automatic Mercure config resolution (true) or declare explicit Mercure options (topics, withCredentials, debounceMs)
apiPlatformboolfalseOpt-in to API Platform integration: auto Ajax URL wiring and column auto-detection from API Platform metadata
editModalTemplatestring''Optional Twig template path for the inline edit modal
editModalAdapterstring''Optional modal adapter override (bootstrap, custom, …)

Use this attribute to:

  • auto-configure the Doctrine data provider used internally by AbstractDataTable
  • opt-in to API Platform-driven column auto-detection (apiPlatform: true required)
  • opt-in to automatic API collection URL resolution for Ajax wiring (apiPlatform: true required)
  • auto-attach a Mercure config when Mercure is enabled for the table
  • declare explicit Mercure topics with mercure: ['topics' => [...]]

#[Column]

Target: property

#[Column(title: 'Email', searchable: true, orderable: true)]
private string $email;

Arguments:

GroupArguments
Identitytype, name, title
Visibility and behaviororderable, searchable, visible, exportable, globalSearchable, hideWhenUpdating
Renderingwidth, className, cellType, defaultContent, renderAsBadges, responsivePriority
Data mappingfield, format, position

Use this attribute when you want column metadata close to your entity model.