Skip to content

Commit 5172a75

Browse files
loic425stlgaits
andcommitted
Apply suggestions from code review
Co-authored-by: Estelle Gaits <74190794+stlgaits@users.noreply.github.com>
1 parent eb4ef22 commit 5172a75

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/cookbook/admin_panel/grid_export.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ In this example, we'll create a CSV export.
1010

1111
First, create the responder using the [https://github.com/portphp/csv](portphp/csv) package.
1212

13+
{% code title="src/Shared/Infrastructure/Sylius/Resource/ExportGridToCsvResponder.php" lineNumbers="true" %}
1314
```php
1415
<?php
1516

@@ -132,6 +133,7 @@ final readonly class ExportGridToCsvResponder implements ResponderInterface
132133
}
133134
}
134135
```
136+
{% endcode %}
135137

136138
## Configure a new operation
137139

@@ -189,7 +191,7 @@ use Sylius\Component\Grid\Attribute\AsGrid;
189191
final class BookGrid extends AbstractGrid
190192
{
191193
#[\Override]
192-
public function buildGrid(GridBuilderInterface $gridBuilder): void
194+
public function __invoke(GridBuilderInterface $gridBuilder): void
193195
{
194196
$gridBuilder
195197
// ...
@@ -230,7 +232,7 @@ You can configure the template for the export action
230232

231233
## Configure the translation key
232234

233-
In the export action Twig template, we have introduced the `app.ui.translation` translation key.
235+
In the export action Twig template, we have introduced the `app.ui.export` translation key.
234236
So we need to configure its translation.
235237

236238
{% code title="translations/messages.en.yaml" lineNumbers="true" %}
@@ -242,9 +244,9 @@ app:
242244
```
243245
{% endcode %}
244246
245-
## Configure the export action template in the grid bundle globally
247+
## Global config template for export actions
246248
247-
If you do not want to repeat the `setTemplate` option in your grid configurations, you can configure it globally in the Grid bundle.
249+
To avoid repeating the `setTemplate` option across grid configurations, define it globally in the Grid Bundle config.
248250

249251
{% code title="config/packages/sylius_grid.yaml" lineNumbers="true" %}
250252
```yaml

0 commit comments

Comments
 (0)