PHPackages                             anklimsk/cakephp-spreadsheet - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. anklimsk/cakephp-spreadsheet

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

anklimsk/cakephp-spreadsheet
============================

Generate MS Excel files with the CakePHP 2.x

v1.0.3(6y ago)0139[1 issues](https://github.com/anklimsk/cakephp-spreadsheet/issues)MITPHPPHP &gt;=5.4

Since Aug 6Pushed 6y agoCompare

[ Source](https://github.com/anklimsk/cakephp-spreadsheet)[ Packagist](https://packagist.org/packages/anklimsk/cakephp-spreadsheet)[ Docs](https://github.com/anklimsk/cakephp-spreadsheet)[ RSS](/packages/anklimsk-cakephp-spreadsheet/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (3)Versions (9)Used By (0)

CakePHP 2.x Generate MS Excel files plugin
==========================================

[](#cakephp-2x-generate-ms-excel-files-plugin)

[![Build Status](https://camo.githubusercontent.com/4f495b408d218e6b3956f924056482362d2f686882e00155e087de8a8aa695f7/68747470733a2f2f7472617669732d63692e636f6d2f616e6b6c696d736b2f63616b657068702d73707265616473686565742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/anklimsk/cakephp-spreadsheet)[![Coverage Status](https://camo.githubusercontent.com/77dfe2d3a6f2870063f818c3a6554cf3cb28931d54b886a4b6e9542eeb99f815/68747470733a2f2f636f6465636f762e696f2f67682f616e6b6c696d736b2f63616b657068702d73707265616473686565742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/anklimsk/cakephp-spreadsheet)[![Latest Stable Version](https://camo.githubusercontent.com/812a34f8a544535e0e76592b5bb996a5bfb204c4eac7960b8eb976594736c0bb/68747470733a2f2f706f7365722e707567782e6f72672f616e6b6c696d736b2f63616b657068702d73707265616473686565742f76657273696f6e)](https://packagist.org/packages/anklimsk/cakephp-spreadsheet)[![License](https://camo.githubusercontent.com/3a1ae337546022e84cff54ead42fca29f35fcc8bd61dd543d4ceb6f0d0cff4f6/68747470733a2f2f706f7365722e707567782e6f72672f616e6b6c696d736b2f63616b657068702d73707265616473686565742f6c6963656e7365)](https://packagist.org/packages/anklimsk/cakephp-spreadsheet)

Generate MS Excel files with the CakePHP

This plugin provides next features:
-----------------------------------

[](#this-plugin-provides-next-features)

- Generate MS Excel files

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

[](#installation)

1. Install the Plugin using composer: `composer require anklimsk/cakephp-spreadsheet`
2. Add the next line to the end of the file `app/Config/bootstrap.php`:

    ```
    CakePlugin::load('CakeSpreadsheet', ['bootstrap' => true, 'routes' => true]);
    ```

Using this plugin
-----------------

[](#using-this-plugin)

1. In your `Model`:

    - Create the following methods:

        ```
        public function getExportConfig() {
           $header = [__('Field label 1'), __('Field label 2'), __('Field label 3'), __('Field label 4')];
           $width = [35, 20, 10, 15];
           $align = ['L', 'L', 'C', 'R'];
           $fileName = __('Export file');

           return compact('header', 'width', 'align', 'fileName');
        }

        public function getExportData($conditions = []) {
            ...
            $result = [
                'Group header (List name)' => [
                    'Sub header' => [
                        [
                            'Field value 1',
                            'Field value 2',
                            'Field value 3',
                            'Field value 4',
                        ]
                    ]
                ]
            ];

            return $result;
        }
        ```
2. In your `Controller`:

    - Add the `RequestHandler` component to `AppController`, and map `xlsx` to the CakeSpreadsheet plugin, e.g.:

        ```
        public $components = [
            ...,
            'RequestHandler' => [
                'viewClassMap' => [
                    'xlsx' => 'CakeSpreadsheet.Spreadsheet'
                ]
            ]
        ];
        ```
    - Add to your controller action:

        ```
        public export($id = null) {
           if (!$this->RequestHandler->prefers('xlsx')) {
              throw new BadRequestException(__('Invalid export type');
           }

           $conditions = [];
           if (!empty($id)) {
              $conditions['Model.id'] = $id;
           }
           $exportConfig = $this->Model->getExportConfig();
           $exportData = $this->Model->getExportData();

           $this->set(compact('exportConfig', 'exportData'));
        }
        ```
3. In your `View`:

    - Create a link to the a action with the extension `.xlsx`, e.g.:

        ```
        $this->Html->link('Excel file', ['ext' => 'xlsx']);
        ```
    - Place the View templates in the subdirectory `Spreadsheet`, e.g.: `app/View/Invoices/Spreadsheet/index.ctp`

        ```
        if (isset($fileName)) {
           $this->setFileName($fileName);
        }

        $this->Spreadsheet->getDefaultStyle()->applyFromArray([
           'font' => [
              'name' => 'Arial Cyr',
              'size' => 10,
            ],
        ]);
        ```
    - Use the `CakeSpreadsheet.exportExcelTable` element in your View file, e.g.:

        ```
        echo $this->element('CakeSpreadsheet.exportExcelTable', compact('exportConfig', 'exportData'));
        ```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

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 ~137 days

Total

7

Last Release

2233d ago

Major Versions

v0.1.4 → v1.0.02018-10-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/140887a79183c767c877d9ddb80aeaf88e0abd091f8dc1cd6e599ab7e30e1d82?d=identicon)[anklimsk](/maintainers/anklimsk)

---

Top Contributors

[![anklimsk](https://avatars.githubusercontent.com/u/42044955?v=4)](https://github.com/anklimsk "anklimsk (39 commits)")

---

Tags

cakephp-plugincakephp2spreadsheet

### Embed Badge

![Health badge](/badges/anklimsk-cakephp-spreadsheet/health.svg)

```
[![Health](https://phpackages.com/badges/anklimsk-cakephp-spreadsheet/health.svg)](https://phpackages.com/packages/anklimsk-cakephp-spreadsheet)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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