2017 © Pedro Peláez
 

yii2-extension yii2-export

Just another yii2 export menu component.

image

ericmaicon/yii2-export

Just another yii2 export menu component.

  • Wednesday, March 16, 2016
  • by ericmaicon
  • Repository
  • 1 Watchers
  • 3 Stars
  • 66 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 2 Versions
  • 29 % Grown

The README.md

Just another Yii2 Export Widget for Yii2

Latest Version Build Status, (*1)

The main purpose of this library is not replace kartik-v/yii2-export. Kartik's one has a lot of features not implemented on this one., (*2)

This is a new yii2-export widget wrote from the scratch to improve performance., (*3)

The idea of this one appeared when PHPExcel doesn't fit to generate large excel files in a fast way. The first feature was dispatch reports to be generated in queues., (*4)

Not enough, another feature was replace PHPExcel with spout, successfully reducing the time consuming., (*5)

Installation

The preferred way to install this extension is through composer., (*6)

Either run, (*7)

$ composer require ericmaicon/yii2-export:*

or add, (*8)

"ericmaicon/yii2-export": "*"

to the require section of your composer.json file., (*9)

Usage

Using with the Grid:, (*10)

<?= \Da\export\GridView::widget([
    'dataProvider' => $dataProvider,
]); ?>

To use Kartik's grid you will need to override renderExport method:, (*11)

<?php

use Da\export\ExportMenu;

class GridView extends \kartik\grid\GridView
{
    public function renderExport()
    {
        return ExportMenu::widget([
            'dataProvider' => $this->dataProvider,
            'columns' => $this->columns,
        ]);
    }
}

Stand-alone use:, (*12)


Another configurations:, (*13)

Queue, (*14)

[
    'target' => \Da\export\ExportMenu::TARGET_QUEUE,
    'queueConfig' => [
        'queueName' => \common\models\ReportModel::REPORT_TUBE,
        'queueAdapter' => \Da\export\queue\rabbitmq\RabbitMqQueueStoreAdapter::className(),
        'queueMessage' => function () {

        }
    ]
]

Target, (*15)

[
    'target' => \Da\export\ExportMenu::TARGET_SELF,
]

Filename, (*16)

[
    'filename' => 'test',
]

Export Footer, (*17)

[
    'exportFooter' => true,
]

Options, (*18)

[
    'class' => 'btn-group',
]

Dropdown Options, (*19)

[
    'class' => 'btn btn-default',
    'label' => 'Export',
    'menuOptions' => [
        'class' => 'dropdown-menu dropdown-menu-right'
    ]
]

Dropdown Items, (*20)

[
    ExportMenu::FORMAT_CSV => [
        'label' => 'CSV',
        'options' => [
            'title' => 'Comma Separated Values',
            'data-id' => ExportMenu::FORMAT_CSV,
        ],
        'url' => 'javascript:;',
        'className' => CsvOption::className(),
    ]
]

Selected Option, (*21)

[
    'selectedOption' => ExportMenu::FORMAT_CSV,
]

Testing

$ ./vendor/bin/phpunit

What is missing?

  1. PDF, HTML and TXT export options
  2. Confirm Alert
  3. Column selectors
  4. Store file
  5. Events
  6. Internationalization

The Versions

16/03 2016

dev-master

9999999-dev https://github.com/ericmaicon/yii2-export

Just another yii2 export menu component.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Eric Maicon

extension yii export

16/03 2016

1.0

1.0.0.0 https://github.com/ericmaicon/yii2-export

Just another yii2 export menu component.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Eric Maicon

extension yii export