Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Wisembly/ExcelAnt
Simple yet powerful Excel manipulation library for PHP 5.4+
https://github.com/Wisembly/ExcelAnt
Last synced: 3 months ago
JSON representation
Simple yet powerful Excel manipulation library for PHP 5.4+
- Host: GitHub
- URL: https://github.com/Wisembly/ExcelAnt
- Owner: Wisembly
- License: other
- Created: 2013-05-23T12:45:12.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-08T08:57:21.000Z (over 10 years ago)
- Last Synced: 2024-07-09T22:51:16.188Z (4 months ago)
- Language: PHP
- Homepage: http://wisembly.github.io/ExcelAnt
- Size: 1.05 MB
- Stars: 69
- Watchers: 25
- Forks: 17
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
| |
\ /
\_/
__ /^\ __
' `. \_/ ,' `
\/ \/
_,--./| |\.--._
_,' _.-\_/-._ `._
| / \ |
| / \ |
/ | | \
-' \___/ `-#ExcelAnt
[![Build Status](https://travis-ci.org/Wisembly/ExcelAnt.png?branch=master)](https://travis-ci.org/Wisembly/ExcelAnt)
ExcelAnt is an Excel manipulation library for PHP 5.4. It currently works on top of [PHPExcel](https://github.com/PHPOffice/PHPExcel).
If you want to add / use another library, feel free to fork and contribute !#Version
1.0.0
#Installation
1. Install composer : `curl -s http://getcomposer.org/installer | php`
(more info at getcomposer.org)
2. Create a `composer.json` file in your project root :
(or add only the excelant line in your existing composer file)```yml
{
"require": {
"wisembly/excelant": "*",
}
}
```3. Install via composer : `php composer.phar install`
#Use ExcelAnt
Create a simple Table :
```php
use ExcelAnt\Adapter\PhpExcel\Workbook\Workbook,
ExcelAnt\Adapter\PhpExcel\Sheet\Sheet,
ExcelAnt\Adapter\PhpExcel\Writer\Writer,
ExcelAnt\Table\Table,
ExcelAnt\Coordinate\Coordinate;Class Export
{
public function createExport(array $users)
{
$workbook = new Workbook();
$sheet = new Sheet($workbook);
$table = new Table();foreach ($users as $user) {
$table->setRow([
$user->getName(),
$user->getEmail(),
]);
}$sheet->addTable($table, new Coordinate(1, 1));
$workbook->addSheet($sheet);
}
}
```Now, to export your Workbook, you need to create a Writer :
```php
use ExcelAnt\Adapter\PhpExcel\Writer\WriterFactory,
ExcelAnt\Adapter\PhpExcel\Writer\PhpExcelWriter\Excel5;$writer = (new WriterFactory())->createWriter(new Excel5('/path/to/myExport.xls'));
```Convert your Worbook to create a PHPExcel object and export it :
```php
$phpExcel = $writer->convert($workbook);
$writer->write($phpExcel);
```![Simple table](https://raw.github.com/Wisembly/ExcelAnt/master/docs/simple-table.png)
#Documentation
Coming soon...
#Contributing
ExcelAnt is an open source project. If you would like to contribute, fork the repository and submit a pull request.
#Running ExcelAnt Tests