Download the PHP package mobizel/sylius-export-plugin without Composer
On this page you can find all versions of the php package mobizel/sylius-export-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mobizel/sylius-export-plugin
More information about mobizel/sylius-export-plugin
Files in mobizel/sylius-export-plugin
Package sylius-export-plugin
Short Description Bulk export of sylius resources
License MIT
Informations about the package sylius-export-plugin
Mobizel Export plugin
Getting started
This plugin add a new bulkAction 'export' to all Sylius resources.
It use the default resource grid definition to export data.
You can also use a specific grid for export.
It allow you to export:
- All entities
- All entities filtered by search
- Selected entities (with checkbox)
IMPORTANT: This plugin does not depend on ` but only and , so it can be used in other project like the symfony starter monofony.
Installation
-
Require and install the plugin
- Run
composer require mobizel/sylius-export-plugin
- Run
- Register the bundle:
=> If you do not use you have to import the plugin in the Kernel.
Configuration
GRID configuration:
Create file if not exist and add new bulk action
`
Add new button macro
Add this following file to add the new button macro.
`
Javascript integration
Integrate in your javascript build (webpack / gulp) or directly in twig (you need to copy file to your assets directory)
Twig integration example:
How to use it
Example
You only have to add export bulk action to your grid, example with customer grid, create file to override customer's grid:
`
Next, enable your grid.
Edit and add on the top:
`
How to enable export of selected entities
Export of selected entities does not work out of the box. You need to override the entity repository.
Example for customer:
-
Create CustomerRepository class: `` Note: We add new method to fetch entities filtered by id
-
Create file ` if not exist
-
Set custom repository in this file
- Update customer grid to user new method:
`
complete file: `
How to use custom grid
If you want to use a custom grid while export entites, you just have to override the route and specify the grid paramter, example for customer:
`
Custom export format
This plugin only use CSV for export, however you can implement your own export. Create a new class that implements .
If you create an with method ``
you can change the export format in the route definition: `
CSV settings
You can configure setting of the CSV writer.
Contributing
Would like to help us ? Feel free to open a pull-request!
License
Sylius export plugin is completely free and released under the MIT License.
Authors
Sylius export plugin was originally created by Kévin REGNIER.
All versions of sylius-export-plugin with dependencies
sylius/grid-bundle Version ^1.10
sylius/resource-bundle Version ^1.8
portphp/csv Version ^1.1
symfony/asset Version ^5.3