PHPackages                             ondics/yii1spreadsheet - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. ondics/yii1spreadsheet

ActiveYii1-extension[PDF &amp; Document Generation](/categories/documents)

ondics/yii1spreadsheet
======================

Yii1 extension for export to a spreadsheet, e.g. Excel, LibreOffice etc.

v0.2.0(4y ago)2207BSD-3-ClausePHP

Since Feb 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/ondics/yii1spreadsheet)[ Packagist](https://packagist.org/packages/ondics/yii1spreadsheet)[ RSS](/packages/ondics-yii1spreadsheet/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Yii1 Spreadsheet Extensions
===========================

[](#yii1-spreadsheet-extensions)

Provides very easy Excel-Output for Yii1

- works with `CArrayDataProvider`
- works with `CActiveDataProvider`
- provides flexible value formatting with PHP closures (see below)

This extension was built because the extension [phpoffice/phpexcel](https://packagist.org/packages/phpoffice/phpexcel) is marked as "archived/abandoned" and there was no Yii1 extension as successor to use the recommended [PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet) library.

Tested with Yii1 version 1.1.25

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist ondics/yii1spreadsheet

```

or add

```
"ondics/spreadsheet": "*"
```

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

Usage
-----

[](#usage)

```
$dataProvider = new CArrayDataProvider([
    [
        'name' => 'some name',
        'price' => '9879',
    ],
    [
        'name' => 'name 2',
        'price' => '79',
    ],
]);
$exporter = new Spreadsheet();
$exporter->dataProvider = $dataProvider;
$exporter->columns = [
    'name',
    [
        'attribute' => 'price',
        'header' => 'Price with VAT',
        'value' => function($model,$key,$index,$x) {
            return $model->price * 1.19;
          },
          'visible' => ($model->price  > 20),
];
$exporter->send('myexcelfile.xlsx');

```

Application Notes
-----------------

[](#application-notes)

This yii1 extension is a light backport of  to Yii1. Some Yii2 base classes and features are required and thus provided with this extensions and can be used during Excel export, e.g.

- In `colums` a closure can be used as value. This closue differs from the closure in Yii1. See the example above how to use this closure.
- The columns array is backported from Yii2 so see Yii2 docs for information

The `send` method cannot not use xsendfile to send a file directyle to the browser but has go over memory. This may affect very large Excel exports.

Credits
-------

[](#credits)

Thanks to [https://patreon.com/klimov\_paul](https://patreon.com/klimov_paul) and yii2tech which provide

Author
------

[](#author)

(C) 2022, Ondics GmbH

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

###  Release Activity

Cadence

Every ~12 days

Total

2

Last Release

1573d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/083a9f7ebc05327e0cb1c65c7c49effaee1571711ca67f0ae926dcf9a4ede369?d=identicon)[Githubler](/maintainers/Githubler)

---

Top Contributors

[![ondics](https://avatars.githubusercontent.com/u/1729357?v=4)](https://github.com/ondics "ondics (9 commits)")

---

Tags

excelspreadsheetyii-extensionyii1exportexcelxlsxlsxspreadsheetYii1LibreOffice

### Embed Badge

![Health badge](/badges/ondics-yii1spreadsheet/health.svg)

```
[![Health](https://phpackages.com/badges/ondics-yii1spreadsheet/health.svg)](https://phpackages.com/packages/ondics-yii1spreadsheet)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k309.6M1.5k](/packages/phpoffice-phpspreadsheet)[avadim/fast-excel-writer

Lightweight and very fast XLSX Excel Spreadsheet Writer in PHP

3021.3M9](/packages/avadim-fast-excel-writer)[kartik-v/yii2-export

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

1613.2M36](/packages/kartik-v-yii2-export)[nuovo/spreadsheet-reader

Spreadsheet reader library for Excel, OpenOffice and structured text files

668883.3k8](/packages/nuovo-spreadsheet-reader)[kebacorp/arrayexcelbuilder

The extension creates an Excel file from the data array.

126.5k](/packages/kebacorp-arrayexcelbuilder)[avadim/fast-excel-reader

Lightweight and very fast XLSX Excel Spreadsheet and CSV Reader in PHP

106693.8k9](/packages/avadim-fast-excel-reader)

PHPackages © 2026

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