Exporting grid data

In this cookbook, we assume that you have already created a Book resource and configured a grid to show a book list.

In this example, we'll create a CSV export.

Exporting grid data

The responder

First, create the responder using the https://github.com/portphp/csvarrow-up-right package.

Configure a new operation

Configure the grid

Create the export action Twig template

You can configure the template for the export action

Configure the translation key

In the export action Twig template, we have introduced the app.ui.export translation key. So we need to configure its translation.

Global config template for export actions

To avoid repeating the setTemplate option across grid configurations, define it globally in the Grid Bundle config.

Last updated

Was this helpful?