2017 © Pedro Peláez
 

symfony-bundle sonata-admin-extra-export-bundle

Sonata Admin extra export formats (pdf, jpg)

image

whyte624/sonata-admin-extra-export-bundle

Sonata Admin extra export formats (pdf, jpg)

  • Tuesday, September 19, 2017
  • by whyte624
  • Repository
  • 1 Watchers
  • 8 Stars
  • 1,584 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

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., (*1)

The SonataAdminExtraExportBundle provides a simple integration for your Symfony project with Sonata Admin and adds support of:, (*2)

Installation

With composer, add:, (*3)

{
    "require": {
        "whyte624/sonata-admin-extra-export-bundle": "dev-master"
    }
}

Then enable it in your kernel:, (*4)

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        //...
        new Whyte624\SonataAdminExtraExportBundle\Whyte624SonataAdminExtraExportBundle(),
        new Knp\Bundle\SnappyBundle\KnpSnappyBundle(),
        //...

Configuration

Configure KnpSnappyBundle., (*5)

[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., (*6)

Add trait to Admin class:, (*7)

//src/Acme/AcmeBundle/Admin/MyAdmin.php
use Sonata\AdminBundle\Admin\Admin;
use Whyte624\SonataAdminExtraExportBundle\Admin\AdminExtraExportTrait;

class MyAdmin extends Admin
{
    //...
    use AdminExtraExportTrait;
    //...

Add trait to CRUDController class, (*8)

//src/Acme/AcmeBundle/Controller/MyCRUDController.php
use Sonata\AdminBundle\Controller\CRUDController;
use Whyte624\SonataAdminExtraExportBundle\Controller\CRUDControllerExtraExportTrait;

class MyCRUDController extends CRUDController
{
    //...
    use CRUDControllerExtraExportTrait;
    //...

This will add extra export formats to your admin., (*9)

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., (*10)

Override getPdfOptions class in your CRUDController class to change orientation to landscape., (*11)

The Versions

19/09 2017

dev-master

9999999-dev https://github.com/whyte624/sonata-admin-extra-export-bundle

Sonata Admin extra export formats (pdf, jpg)

  Sources   Download

MIT

The Requires

 

bundle export admin sonata knplabs pdf jpg sonataadmin snappy sonata admin knp

19/09 2017

1.2

1.2.0.0 https://github.com/whyte624/sonata-admin-extra-export-bundle

Sonata Admin extra export formats (pdf, jpg)

  Sources   Download

MIT

The Requires

 

bundle export admin sonata knplabs pdf jpg sonataadmin snappy sonata admin knp

23/11 2015

1.0

1.0.0.0 https://github.com/whyte624/sonata-admin-extra-export-bundle

Sonata Admin extra export formats (pdf, jpg)

  Sources   Download

MIT

The Requires

 

bundle export admin sonata knplabs pdf jpg sonataadmin snappy sonata admin knp

23/11 2015

1.1

1.1.0.0 https://github.com/whyte624/sonata-admin-extra-export-bundle

Sonata Admin extra export formats (pdf, jpg)

  Sources   Download

MIT

The Requires

 

bundle export admin sonata knplabs pdf jpg sonataadmin snappy sonata admin knp