Skip to content

edukondaluetg/CakeExcel

 
 

Repository files navigation

CakeExcel

Coverage Status Build Status

A plugin to generate Excel files with CakePHP.

Requirements

  • PHP 5.2.8
  • CakePHP 2.1+
  • PHPExcel
  • Composer

Installation

Add to your composer.json file (dakota/cake-excel)

"dakota/cake-excel": ">=1.0"

Or run

composer require "dakota/cake-excel >=1.0"

Usage

In app/Config/bootstrap.php add:

CakePlugin::load('CakeExcel', array('bootstrap' => true, 'routes' => true));

Add the RequestHandler component to AppController, and map xlsx to the CakeExcel plugin

'RequestHandler' => array(
	'viewClassMap' => array(
		'xlsx' => 'CakeExcel.Excel'
	)
),

Create a link to the a action with the .xlsx extension

$this->Html->link('Excel file', array('ext' => 'xlsx'));

Place the view templates in a 'Excel' subdir, for instance app/View/Invoices/Excel/index.ctp

Inside your view file you will have access to the PHPExcel library with $this->PhpExcel. Please see the PHPExcel documentation for a guide on how to use PHPExcel.

About

A plugin to generate Excel files with CakePHP. Uses the PdfExcel library as a submodule

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%