You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/grid/field_types.md
+113
Original file line number
Diff line number
Diff line change
@@ -311,3 +311,116 @@ $field->setOptions([
311
311
```
312
312
{% endcode %}
313
313
{% endhint %}
314
+
315
+
## Callable
316
+
317
+
The Callable column aims to offer almost as much flexibility as the Twig column, but without requiring the creation of a template.
318
+
You simply need to specify a callable, which allows you to transform the 'data' variable on the fly.
319
+
320
+
When defining callables in YAML, only string representations of callables are supported.
321
+
When configuring grids using PHP (as opposed to service grid configuration), both string and array callables are supported. However, closures cannot be used due to restrictions in Symfony's configuration (values of type "Closure" are not permitted in service configuration files).
322
+
By contrast, when configuring grids with service definitions, you can use both callables and closures.
0 commit comments