Skip to content

Commit

Permalink
docs: add documentation of the column value_translation_parameters
Browse files Browse the repository at this point in the history
…option
  • Loading branch information
Kreyu committed Nov 24, 2024
1 parent 3079b67 commit e3a8211
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/src/reference/types/column/options/column.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ Sets the parameters used when translating the column header.
Sets the translation domain used when translating the column value.
Setting the option to `false` disables its translation.

### `value_translation_parameters`

Sets the parameters used when translating the column value.

If given the callable, it will receive two arguments:
- column value, e.g. column (row) data formatted by the optional `formatter` option;
- column (row) data, e.g. value returned by property accessor or getter;

```php
// Assume the data table of User entities
$builder->addColumn('firstName', options: [
'value_translation_parameters' => function (string $firstName, User $user) {
return [...];
},
]);
```

The `ColumnValueView` will contain the resolved callable.

### `property_path`

- **type**: `null`, `false` or `string`
Expand Down

0 comments on commit e3a8211

Please sign in to comment.