PHPackages                             ruskid/yii2-excel-exporter - 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. ruskid/yii2-excel-exporter

ActiveYii2-extension

ruskid/yii2-excel-exporter
==========================

Helper to export Active Records to CSV

0996PHP

Since Oct 27Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 CSV Exporter
=================

[](#yii2-csv-exporter)

This will export Active Records into Excel file

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist ruskid/yii2-excel-exporter "dev-master"

```

or add

```
"ruskid/yii2-excel-exporter": "dev-master"

```

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

Usage
-----

[](#usage)

```
 $exporter = new CSVExporter;
//Add headers A1-A3
$exporter->setCellValue('A1', 'Subcategoria');
$exporter->setCellValue('A2', 'Propietario');
$exporter->setCellValue('A3', 'Escenario');
//Apply header styles for A1-A3
for ($i = 1; $i setCellStyleFromArray('A' . $i, $exporter->headerStyle);
}
//Set values to B1-B3
$exporter->setCellValue('B1', $model->name);
$exporter->setCellValue('B2', $model->propietario);
$exporter->setCellValue('B3', $model->escenario);

//Set server data. start from line A11. will return next free cell index
$nextCellIndex = $exporter->setCellData('A11', $model->servers, [
    [
        'header' => Yii::t('app', 'HOSTNAME'),
        'value' => function($array) {
            return $array['HOSTNAME'];
        }
    ],
    [
        'header' => Yii::t('app', 'DESC_CATALOGO'),
        'value' => function($array) {
            return $array['DESC_CATALOGO'];
        }
    ],
]);

//set users from next cell free cell index
$users = \app\models\User::find()->all();
$exporter->setCellData($nextCellIndex, $users, [
    [
        'header' => Yii::t('app', 'Login'),
        'value' => function($object) {
            return $object->username;
        }
    ],
]);

$exporter->filename = 'test';
return $exporter->export();
```

- You can also add **styling**, see style and headerStyle parameters.

###  Health Score

23

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/12093591a2c01098c8613b3d765dd14f64e952691b0048cd0f5ee65438a77244?d=identicon)[ruskid](/maintainers/ruskid)

---

Top Contributors

[![ruskid](https://avatars.githubusercontent.com/u/8279841?v=4)](https://github.com/ruskid "ruskid (40 commits)")

### Embed Badge

![Health badge](/badges/ruskid-yii2-excel-exporter/health.svg)

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

PHPackages © 2026

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