Download the PHP package robotusers/cakephp-excel without Composer
On this page you can find all versions of the php package robotusers/cakephp-excel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download robotusers/cakephp-excel
More information about robotusers/cakephp-excel
Files in robotusers/cakephp-excel
Package cakephp-excel
Short Description Robotusers CakePHP Excel plugin
License MIT
Homepage https://github.com/robotusers/cakephp-excel
Informations about the package cakephp-excel
CakePHP Excel plugin
CakePHP Excel plugin allows for spreadsheet files manipulation with the power of CakePHP ORM. This plugin is build using PHPSpreadsheet library and can work with multiple types of spreadsheet files (excel, csv etc).
Installation
Using the plugin
Excel plugin lets you manipulate spreadsheet files multiple ways. The simplest use case is to load your spreadhseet data into CakePHP ORM table.
For example we are loading an excel file that contains some record data.
A | B | C | |
---|---|---|---|
1 | Led Zeppelin | Led Zeppelin II | 1969 |
2 | Deep Purple | Machine Head | 1972 |
3 | Pink Floyd | Wish You Were Here | 1975 |
Spreadsheet data is now loaded into CakePHP ORM table.
Each column is represented as a property. Values are string
by default.
You may also map columns to custom properties and types.
Spreadsheet data is now loaded into CakePHP ORM with custom properties and types.
You may want to manipulate some data and write it back to excel file. This is also possible.
Now the new record is saved, but excel file has not been updated yet. You have to call writeSpreadsheet()
method:
You may also want to read or write only some of the rows and columns.
Note that _row
does not match the real row index. To keep original row indexes you must use keepOriginalRows
option.
The same principle applies to writing to a file. If you delete the second row it won't become empty in result excel file when keepOriginalRows
is false
. You have to set this option to true
if you want to keep rows consistency across the table and the file.
Behavior
This plugin provides a behavior which could be added to any table.
If you want to load data into your table you have to set a worksheet instance.
Now your table is populated with excel data.
If you want to write your data back to excel file you have to set a file.
Working with different tables
It is also possible to load data into any table.
All versions of cakephp-excel with dependencies
phpoffice/phpspreadsheet Version ^1.1
cakephp/filesystem Version ~4.0
cakephp/orm Version ~4.0