Attributes

#[AsDataTable]

Target: class

#[AsDataTable(User::class, serializationGroups: ['user:list'], mercure: true, apiPlatform: true)]

Arguments:

Argument Type Default Description
`entityClass``string`requiredDoctrine entity class linked to the table
`serializationGroups``string[]``[]`API Platform serialization groups used during column auto-detection (requires `apiPlatform: true`)
`mercure``bool``false`Enable automatic Mercure config resolution for the table
`apiPlatform``bool``false`Opt-in to API Platform integration: auto Ajax URL wiring and column auto-detection from API Platform metadata

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

#[Column]

Target: property

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

Arguments:

Group Arguments
Identity`type`, `name`, `title`
Visibility and behavior`orderable`, `searchable`, `visible`, `exportable`, `globalSearchable`
Rendering`width`, `className`, `cellType`, `render`, `defaultContent`
Data mapping`field`, `format`, `position`

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