Skip to content

kartik-v/yii2-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.) using the PHPExcel library. The widget allows you to configure the dataProvider, columns just like a yii\grid\GridView. However, it just displays the export actions in form of a ButtonDropdown menu, for embedding into any of your GridView or other components.

Demo

You can see detailed documentation and demonstration on usage of the extension.

Latest Release

NOTE: The latest version of the extension is v1.0.0 released on 17-Dec-2014. Refer the CHANGE LOG for details.

Installation

The preferred way to install this extension is through composer.

Note: Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

Either run

$ php composer.phar require kartik-v/yii2-export "dev-master"

or add

"kartik-v/yii2-export": "dev-master"

to the require section of your composer.json file.

Usage

ExportMenu

use kartik\export\ExportMenu;
$gridColumns = [
    ['class' => 'yii\grid\SerialColumn'],
    'id',
    'name',
    'color',
    'publish_date',
    'status',
    ['class' => 'yii\grid\ActionColumn'],
];

// Renders a export dropdown menu
echo ExportMenu::widget([
    'dataProvider' => $dataProvider,
    'columns' => $gridColumns
]);

// You can choose to render your own GridView separately
echo \kartik\grid\GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => $gridColumns
]);

License

yii2-export is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

About

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 41