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. [File &amp; Storage](/categories/file-storage)
4. /
5. ruskid/yii2-excel-exporter

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

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 1mo ago

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 27% 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)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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