PHPackages                             jdominguezpaz/cakespreadsheet - 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. jdominguezpaz/cakespreadsheet

ActiveCakephp-plugin[PDF &amp; Document Generation](/categories/documents)

jdominguezpaz/cakespreadsheet
=============================

CakePHP excel spreadsheet generator using PHPSpreadsheet (CakePHP 3.x compatible, fixed for 3.8+)

1.0.0(3mo ago)03MITPHPPHP &gt;=5.6.0

Since Jan 31Pushed 3mo agoCompare

[ Source](https://github.com/jdominguezpaz/CakeSpreadsheet)[ Packagist](https://packagist.org/packages/jdominguezpaz/cakespreadsheet)[ Docs](https://github.com/jdominguezpaz/CakeSpreadsheet)[ RSS](/packages/jdominguezpaz-cakespreadsheet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/b41411c9b6623d5e3618ee8481e3e15b78d7bcb53644d28ceabbb1c3bb1ed6eb/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a646f6d696e6775657a70617a2f43616b6553707265616473686565742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/jdominguezpaz/CakeSpreadsheet)[![Coverage Status](https://camo.githubusercontent.com/8646fbf619ce191f868f134758e5d63c2d9940948abfad7c08695c0b928dd797/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6a646f6d696e6775657a70617a2f43616b6553707265616473686565742e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/jdominguezpaz/CakeSpreadsheet?branch=master)[![Total Downloads](https://camo.githubusercontent.com/e90500df8a0a8a660b5c8e8c245b260fe696f1c2d77e1a73d6b58c6b96eafa13/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a646f6d696e6775657a70617a2f63616b6573707265616473686565742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jdominguezpaz/cakespreadsheet)[![Latest Stable Version](https://camo.githubusercontent.com/de73211582449aab3e4b874d3eecca2e4d0769dba3953b0c6adb2364afa44d65/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a646f6d696e6775657a70617a2f63616b6573707265616473686565742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jdominguezpaz/cakespreadsheet)

CakeSpreadsheet
===============

[](#cakespreadsheet)

A plugin to generate Excel spreadsheet files with CakePHP 3.x.

This is a maintained fork of [chrmina/CakeSpreadsheet](https://github.com/chrmina/CakeSpreadsheet), which was modified from [CakeExcel](https://github.com/dakota/CakeExcel) to use PHPSpreadsheet instead of obsolete PHPExcel.

Key Changes in This Fork
------------------------

[](#key-changes-in-this-fork)

- **Fixed deprecation warnings** for CakePHP 3.8+
- Updated to use modern CakePHP 3.x APIs (`Event::getSubject()`, `setConfig()`)
- Active maintenance and versioning
- Ready for Composer/Packagist distribution

Requirements
------------

[](#requirements)

- CakePHP 3.6+
- PHP 5.6.0 or greater
- Patience

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

[](#installation)

*\[Using [Composer](http://getcomposer.org/)\]*

```
composer require jdominguezpaz/cakespreadsheet

```

### Enable plugin

[](#enable-plugin)

Load the plugin in your app's `config/bootstrap.php` file:

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

```

Usage
-----

[](#usage)

First, you'll want to setup extension parsing for the `xlsx` extension. To do so, you will need to add the following to your `config/routes.php` file:

```
# Set this before you specify any routes
Router::extensions('xlsx');
```

Next, we'll need to add a viewClassMap entry to your Controller. You can place the following in your AppController:

```
$this->loadComponent('RequestHandler', ['viewClassMap' => ['xlsx' => 'CakeSpreadsheet.Spreadsheet'], 'enableBeforeRedirect' => false]);
```

Each application *must* have an xlsx layout. The following is a barebones layout that can be placed in `src/Template/Layout/xlsx/default.ctp`:

```
