Download the PHP package whyte624/sonata-admin-extra-export-bundle without Composer
On this page you can find all versions of the php package whyte624/sonata-admin-extra-export-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download whyte624/sonata-admin-extra-export-bundle
More information about whyte624/sonata-admin-extra-export-bundle
Files in whyte624/sonata-admin-extra-export-bundle
Package sonata-admin-extra-export-bundle
Short Description Sonata Admin extra export formats (pdf, jpg)
License MIT
Homepage https://github.com/whyte624/sonata-admin-extra-export-bundle
Informations about the package sonata-admin-extra-export-bundle
SonataAdminExtraExportBundle
[SonataAdminExtraExportBundle][sonata-admin-extra-export-bundle] is a PHP (5.4+) extension for Sonata Admin. By default Sonata Admin has json, xml, csv and xls export formats.
The SonataAdminExtraExportBundle provides a simple integration for your Symfony project with Sonata Admin and adds support of:
- pdf (requires KnpSnappyBundle)
- jpg (requires KnpSnappyBundle)
Installation
With composer, add:
Then enable it in your kernel:
Configuration
Configure KnpSnappyBundle.
[SonataAdminExtraExportBundle][sonata-admin-extra-export-bundle] requires you to add traits with export formats to Admin class and extension of export method to CRUDController class.
Add trait to Admin class:
Add trait to CRUDController class
This will add extra export formats to your admin.
Pdf layout
You can easily add your companies logo to PDF export, by overriding Whyte624SonataAdminExtraExportBundle::html_layout.html.twig. Just make sure, that paths for images and css that you are using are absolute.
Override getPdfOptions class in your CRUDController class to change orientation to landscape.
All versions of sonata-admin-extra-export-bundle with dependencies
sonata-project/admin-bundle Version >=2.3
knplabs/knp-snappy-bundle Version >=1.3