PHPackages                             uranum/yii2-excel-exchange - 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. uranum/yii2-excel-exchange

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

uranum/yii2-excel-exchange
==========================

Yii2 extension for exchanging a data from DB to excel and back again for Yii2 Framework.

1.1.9(6y ago)11.5k↓41.7%MITPHPPHP ^7.0.0

Since Sep 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/uranum/yii2-excel-exchange)[ Packagist](https://packagist.org/packages/uranum/yii2-excel-exchange)[ RSS](/packages/uranum-yii2-excel-exchange/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (12)Used By (0)

Yii 2 Excel Data Exchanger
==========================

[](#yii-2-excel-data-exchanger)

After installing this package you will be able to export data from DB to an excel2007 file and upload the data back again. The package is a module that you need to register in the config file in the module section. The module has a widget that you can use with different AR models in the usual way (for widgets). In the widget's config you need to specify the model name you want to import/export. Other optional properties are listed below.

If the exporting model has a related table the file will have an additional sheet for every table even the ones which don’t have a model. The data in these additional sheets helps to handle related columns. This sheets will be ignored in importing.

Required fields are highlighted in the excel file.

**Note! One file is used for all models! The new exporting will overwrite existing file.**

[![Required fields](https://github.com/uranum/yii2-excel-exchange/raw/master/docs/img/xls_file.png)](https://github.com/uranum/yii2-excel-exchange/blob/master/docs/img/xls_file.png)

There is a feature to backup the table before importing.

Export

[![Export](https://github.com/uranum/yii2-excel-exchange/raw/master/docs/img/export.png)](https://github.com/uranum/yii2-excel-exchange/blob/master/docs/img/export.png)

Import

[![Import](https://github.com/uranum/yii2-excel-exchange/raw/master/docs/img/import.png)](https://github.com/uranum/yii2-excel-exchange/blob/master/docs/img/import.png)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist uranum/yii2-excel-exchange

```

or add

```
"uranum/yii2-excel-exchange": "*"

```

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

\###In config, modules section

```
	'modules' => [
//      ...
		'excel' => [
			'class'  => 'uranum\excel\Module',
			'params' => [
				'uploadPath' => 'uploads', // the path relative to the root
				'fileName'   => 'export',
				'extensions' => 'xls, xlsx',
			],
		],
	],
```

How to use
----------

[](#how-to-use)

\###In view (for example, index.php)

```
use uranum\excel\ExcelExchanger;

//...

echo ExcelExchanger::widget([
	'mainModelName' => $searchModel::className(), // here place model class name
 ]);
```

Widget's properties
-------------------

[](#widgets-properties)

string `$mainModelName` - the name of the model for export/import. It's mandatory property.

string `$fileNameFrom` - path to a file for export/import. Default is `'uploads/export.xlsx'`. The folder must be exist!

string `$notNullColumnColor` - a value of the color for required columns. Default is `'FFDECC'`

string `$nameOfReserveTable` - prefix for the copied table. Default is `'archive_'`

string `$backupUrl` - url for backup action. Default is `'excel/default/backup'`. You can create your own controller with it's actions and change the urls here.

string `$uploadUrl` - url for upload action. Default is `'excel/default/upload'`

string `$importUrl` - url for import action. Default is `'excel/default/import'`

string `$exportUrl` - url for export action. Default is `'excel/default/export'`

integer `$columnWidthOfStringType` - a value of the column's width that has string type. Default is `35`

integer `$columnWidthOfTextType` - a value of the column's width that has text type. Default is `50`

integer `$columnWidthDefault` - a value of the other column's width. Default is `15`

string `$modalId` - a value of the Modal id. Default is `'excelImportModal'`

string `$fileInputId` - a value of the fileInput field id. Default is `'uploadFile'`

string `$exportBtnClass` is the part of css bootstrap class. Default is `'ExcelExchanger::COLOR_SUCCESS'`

string `$uploadBtnClass` is the part of css bootstrap class. Default is `'ExcelExchanger::COLOR_SUCCESS'`

string `$uploadDataBtnClass` is the part of css bootstrap class. Default is `'ExcelExchanger::COLOR_SUCCESS'`

string `$importPopupBtnClass` is the part of css bootstrap class. Default is `'ExcelExchanger::COLOR_DANGER'`

string `$panelColorClass` is the part of css bootstrap class. Default is `'ExcelExchanger::COLOR_DEFAULT'`

string `$fileInputColorClass` is the part of css bootstrap class. Default is `'ExcelExchanger::COLOR_WARNING'`

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~116 days

Total

11

Last Release

2518d ago

PHP version history (2 changes)1.1.6PHP ~7.0.0

1.1.9PHP ^7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c9f9f235c2de107043176b29e425b2cb770ba2bca3a14e80d452b8a7474ac1d?d=identicon)[Eugeny\_Emelyanov](/maintainers/Eugeny_Emelyanov)

---

Top Contributors

[![uranum](https://avatars.githubusercontent.com/u/19322573?v=4)](https://github.com/uranum "uranum (1 commits)")

---

Tags

yii2yii 2yii excelexchange dataexport excelimport excel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/uranum-yii2-excel-exchange/health.svg)

```
[![Health](https://phpackages.com/badges/uranum-yii2-excel-exchange/health.svg)](https://phpackages.com/packages/uranum-yii2-excel-exchange)
```

###  Alternatives

[vova07/yii2-fileapi-widget

The FileAPI widget for Yii2 framework.

4765.5k9](/packages/vova07-yii2-fileapi-widget)[floor12/yii2-module-files

Yii2 module to upload and manage files to your models.

1612.4k6](/packages/floor12-yii2-module-files)[limion/yii2-jquery-fileupload-widget

Blueimp file upload widget for Yii2

1224.5k](/packages/limion-yii2-jquery-fileupload-widget)

PHPackages © 2026

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