PHPackages                             mootensai/yii2-export - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. mootensai/yii2-export

ActiveYii2-extension[File &amp; Storage](/categories/file-storage)

mootensai/yii2-export
=====================

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

04PHP

Since Apr 28Pushed 2y agoCompare

[ Source](https://github.com/mootensai/yii2-export)[ Packagist](https://packagist.org/packages/mootensai/yii2-export)[ RSS](/packages/mootensai-yii2-export/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-export ---

 [![Donate](https://camo.githubusercontent.com/0336bc43d88554a3f2d6c74dddf312bc2c65c2eacca70d83ae40f5567098d00e/68747470733a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal") [![kartikv](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67)](https://www.buymeacoffee.com/kartikv "Buy me a coffee")
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-export------------------)

[![Stable Version](https://camo.githubusercontent.com/c03db048a40b116a0144564a1ab59620b7a748f9a0aa5d71d1996eaea17e7d15/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6578706f72742f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-export)[![Unstable Version](https://camo.githubusercontent.com/0a3961cdc206fa8acc50c24c6e06fc92d29cc08d1385b2ee2ffad45550527642/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6578706f72742f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-export)[![License](https://camo.githubusercontent.com/4bc6130dd4556594a0cb964a913b42bb16ca1a70f785da11a083266333975422/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6578706f72742f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-export)[![Total Downloads](https://camo.githubusercontent.com/09e17236a6d4376d715b8c2ab95ead50b0f55680bc6ed9f64b3e1b69ec32a1f8/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6578706f72742f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-export)[![Monthly Downloads](https://camo.githubusercontent.com/af3056399c578d84a9e3f1f6f2c2aa157b8d04bf38ffaa4bf6a1e3b6b30433ce/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6578706f72742f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-export)[![Daily Downloads](https://camo.githubusercontent.com/e20aa2d416d6affef49ce78eb8a277d20a4942203d92a515c9f7553abfc23e11/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6578706f72742f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-export)

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.) using the [PhpSpreadsheet](https://github.com/PHPOffice/phpspreadsheet) 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.

In addition, with release v1.2.0, the extension also displays a handy grid columns selector for controlling the columns for export. The features available with the column selector are:

- shows a column picker dropdown list to allow selection of columns for export.
- new `container` property allows you to group the export menu and column selector dropdowns.
- new `template` property for manipulating the display of menu, column selector or additional buttons in button group.
- allows configuration of column picker dropdown button through `columnSelectorOptions`
- auto-generates column labels in the column selector. But you can override displayed column labels for each column key through `columnSelector` property settings.
- allows preselected columns through `selectedColumns` (you must set the selected column keys)
- allows columns to be disabled in column selector through `disabledColumns` (you must set the disabled column keys)
- allows columns to be hidden in column selector through `hiddenColumns` (you must set the hidden column keys)
- allows columns to be hidden from both export and column selector through `noExportColumns` (you must set the no export column keys)
- toggle display of the column selector through `showColumnSelector` property
- column selector is displayed only if `asDropdown` is set to `true`.

The extension offers configurable user interfaces for advanced cases using view templates.

- `exportColumnsView` allows you to setup your own custom view file for rendering the column selector dropdown.
- `afterSaveView` allows you to setup your own after save view file if you are configuring to save exported file on server.

Demo
----

[](#demo)

You can see detailed [documentation](http://demos.krajee.com/export) and [demonstration](http://demos.krajee.com/export-demo) on usage of the extension.

Release Changes
---------------

[](#release-changes)

> NOTE: Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-export/blob/master/CHANGE.md) for details on changes to various releases.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

> Note: Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

### Pre-requisites

[](#pre-requisites)

Install the necessary pre-requisite (Krajee Dropdown Extension) based on your bootstrap version:

- For Bootstrap v5.x install the extension `kartik-v/yii2-bootstrap5-dropdown`
- For Bootstrap v4.x install the extension `kartik-v/yii2-bootstrap4-dropdown`
- For Bootstrap v3.x install the extension `kartik-v/yii2-dropdown-x`

For example if you are using the Bootstrap v5.x add the following to the `require` section of your `composer.json` file:

```
"kartik-v/yii2-bootstrap5-dropdown": "@dev"

```

### Install

[](#install)

Either run:

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

```

or add

```
"kartik-v/yii2-export": "@dev"

```

to the `require` section of your `composer.json` file.

> Note: you must run `composer update` to have the latest stable dependencies like `kartik-v/yii2-krajee-base`

Pre-requisites
--------------

[](#pre-requisites-1)

The `yii2-export` extension is dependent on `yii2-grid` extension module. In order to start using `yii2-export`, you need to ensure setup of the `gridview` module in your application modules configuration file. For example:

```
'modules' => [
    'gridview' => [
        'class' => 'kartik\grid\Module',
        // other module settings
    ]
]
```

Usage
-----

[](#usage)

### ExportMenu

[](#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,
    'clearBuffers' => true, //optional
]);

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

Contributors
------------

[](#contributors)

### Code Contributors

[](#code-contributors)

This project exists thanks to all the people who contribute. \[[Contribute](CONTRIBUTING.md)\]. [![](https://camo.githubusercontent.com/609845d794a4303ab94248b4c7701c5bfaddf5d8143a087e485e6bbdd0512ff9/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365)](https://github.com/kartik-v/yii2-export/graphs/contributors)

### Financial Contributors

[](#financial-contributors)

Become a financial contributor and help us sustain our community. \[[Contribute](https://opencollective.com/yii2-export/contribute)\]

#### Individuals

[](#individuals)

[![](https://camo.githubusercontent.com/4029fb2149cd761a82aa2df37ea6d3bde0796303e722dce9e8d02aa3815e530e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f696e646976696475616c732e7376673f77696474683d383930)](https://opencollective.com/yii2-export)

#### Organizations

[](#organizations)

Support this project with your organization. Your logo will show up here with a link to your website. \[[Contribute](https://opencollective.com/yii2-export/contribute)\]

[![](https://camo.githubusercontent.com/37afaba6d00ec1e448d8a586d11a5d6aeb1dea3452bb90460d88de57f51d259b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f302f6176617461722e737667)](https://opencollective.com/yii2-export/organization/0/website)[![](https://camo.githubusercontent.com/c07dcd0784105ff00e7386df499ffdbaca1c9074f872fcef5b3448dffd26ab93/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f312f6176617461722e737667)](https://opencollective.com/yii2-export/organization/1/website)[![](https://camo.githubusercontent.com/e1b70d8c411bcaff9423f73b869a1c5a263ab336598eae0740a5b4b040fa33a7/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f322f6176617461722e737667)](https://opencollective.com/yii2-export/organization/2/website)[![](https://camo.githubusercontent.com/3833c0498e989507dbc350607bd11eb2f9740dd634ac4aea6d2581e68fec5041/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f332f6176617461722e737667)](https://opencollective.com/yii2-export/organization/3/website)[![](https://camo.githubusercontent.com/eab505157acf67397ebe7f426b92a97a0e6dc43d5cc24d2c4f1d007d521b481c/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f342f6176617461722e737667)](https://opencollective.com/yii2-export/organization/4/website)[![](https://camo.githubusercontent.com/effd4470deda4787e1a5920fe3d0f19436767ca8e1998cc57a81cc6814e7704b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f352f6176617461722e737667)](https://opencollective.com/yii2-export/organization/5/website)[![](https://camo.githubusercontent.com/ec8af2cbbaa593fc628f4a3b60b37de54314a111f9daf147c302f594c099859f/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f362f6176617461722e737667)](https://opencollective.com/yii2-export/organization/6/website)[![](https://camo.githubusercontent.com/a5f9bc157ae1759fb2c82a460212e10c83ff4c1ab84cf0db0c86c8cd26a11ead/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f372f6176617461722e737667)](https://opencollective.com/yii2-export/organization/7/website)[![](https://camo.githubusercontent.com/32ef7e2065a1fd12b1206cdf9a797455b34fa01e14456b6475afa3b5c33a6a22/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f382f6176617461722e737667)](https://opencollective.com/yii2-export/organization/8/website)[![](https://camo.githubusercontent.com/558f2b278acc7199e4386fa606c5c12e1d05926a05acc94910e8105272f180e1/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d6578706f72742f6f7267616e697a6174696f6e2f392f6176617461722e737667)](https://opencollective.com/yii2-export/organization/9/website)

License
-------

[](#license)

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

###  Health Score

15

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 81% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6abdf40661b0e9171dce645d1cfd2c9f8fa8547fc0549ee65338b788435650aa?d=identicon)[mootensai](/maintainers/mootensai)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (239 commits)")[![acerix](https://avatars.githubusercontent.com/u/379534?v=4)](https://github.com/acerix "acerix (5 commits)")[![fsateler](https://avatars.githubusercontent.com/u/1322013?v=4)](https://github.com/fsateler "fsateler (4 commits)")[![bscheshirwork](https://avatars.githubusercontent.com/u/5769211?v=4)](https://github.com/bscheshirwork "bscheshirwork (4 commits)")[![friek108](https://avatars.githubusercontent.com/u/8036331?v=4)](https://github.com/friek108 "friek108 (3 commits)")[![deividas1](https://avatars.githubusercontent.com/u/12512225?v=4)](https://github.com/deividas1 "deividas1 (3 commits)")[![Edofre](https://avatars.githubusercontent.com/u/710429?v=4)](https://github.com/Edofre "Edofre (3 commits)")[![fallingdust](https://avatars.githubusercontent.com/u/809582?v=4)](https://github.com/fallingdust "fallingdust (3 commits)")[![ksideks](https://avatars.githubusercontent.com/u/8866725?v=4)](https://github.com/ksideks "ksideks (2 commits)")[![stivehu](https://avatars.githubusercontent.com/u/13046582?v=4)](https://github.com/stivehu "stivehu (2 commits)")[![RomeroMsk](https://avatars.githubusercontent.com/u/4639951?v=4)](https://github.com/RomeroMsk "RomeroMsk (2 commits)")[![GorbachevPavel](https://avatars.githubusercontent.com/u/7292718?v=4)](https://github.com/GorbachevPavel "GorbachevPavel (2 commits)")[![aayaresko](https://avatars.githubusercontent.com/u/8190713?v=4)](https://github.com/aayaresko "aayaresko (2 commits)")[![ananthhh](https://avatars.githubusercontent.com/u/3583234?v=4)](https://github.com/ananthhh "ananthhh (2 commits)")[![ittaskeu](https://avatars.githubusercontent.com/u/23516846?v=4)](https://github.com/ittaskeu "ittaskeu (2 commits)")[![Arnaud-G1](https://avatars.githubusercontent.com/u/8536657?v=4)](https://github.com/Arnaud-G1 "Arnaud-G1 (2 commits)")[![mootensai](https://avatars.githubusercontent.com/u/5844149?v=4)](https://github.com/mootensai "mootensai (2 commits)")[![tphan-tx](https://avatars.githubusercontent.com/u/13983665?v=4)](https://github.com/tphan-tx "tphan-tx (1 commits)")[![aikon2](https://avatars.githubusercontent.com/u/40897348?v=4)](https://github.com/aikon2 "aikon2 (1 commits)")[![bmsrox](https://avatars.githubusercontent.com/u/3869640?v=4)](https://github.com/bmsrox "bmsrox (1 commits)")

### Embed Badge

![Health badge](/badges/mootensai-yii2-export/health.svg)

```
[![Health](https://phpackages.com/badges/mootensai-yii2-export/health.svg)](https://phpackages.com/packages/mootensai-yii2-export)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.2M119](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34388.1M100](/packages/google-cloud-storage)[webimpress/safe-writer

Tool to write files safely, to avoid race conditions

37839.2M27](/packages/webimpress-safe-writer)[league/flysystem-bundle

Symfony bundle integrating Flysystem into Symfony applications

40028.5M68](/packages/league-flysystem-bundle)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26820.5M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15260.6M2.3k](/packages/illuminate-filesystem)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
