2017 © Pedro Peláez
 

library excelant

image

wisembly/excelant

  • Tuesday, October 8, 2013
  • by guillaumepotier
  • Repository
  • 22 Watchers
  • 60 Stars
  • 79,026 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 20 Forks
  • 7 Open issues
  • 8 Versions
  • 5 % Grown

The README.md

       |     |
        \   /
         \_/
    __   /^\   __
   '  `. \_/ ,'  `
        \/ \/
   _,--./| |\.--._
_,'   _.-\_/-._   `._
     |   / \   |
     |  /   \  |
    /   |   |   \
  -'    \___/    `-

ExcelAnt

Build Status, (*1)

ExcelAnt is an Excel manipulation library for PHP 5.4. It currently works on top of PHPExcel. If you want to add / use another library, feel free to fork and contribute !, (*2)

Version

1.0.0, (*3)

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)
  {
    "require": {
      "wisembly/excelant": "*",
    }
  }
  1. Install via composer : php composer.phar install

Use ExcelAnt

Create a simple Table :, (*4)

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 :, (*5)

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 :, (*6)

$phpExcel = $writer->convert($workbook);
$writer->write($phpExcel);

Simple table, (*7)

Documentation

Coming soon..., (*8)

Contributing

ExcelAnt is an open source project. If you would like to contribute, fork the repository and submit a pull request., (*9)

Running ExcelAnt Tests

The Versions

08/10 2013
08/10 2013
11/06 2013

dev-functional-testing

dev-functional-testing https://github.com/wisembly/excelant

  Sources   Download

MIT

The Requires

 

The Development Requires

excel

06/06 2013

dev-csv-export

dev-csv-export https://github.com/wisembly/excelant

  Sources   Download

MIT

The Requires

 

The Development Requires

excel

06/06 2013

dev-writer

dev-writer https://github.com/wisembly/excelant

  Sources   Download

MIT

The Requires

 

The Development Requires

excel

30/05 2013

dev-table-feature

dev-table-feature https://github.com/wisembly/excelant

  Sources   Download

MIT

The Requires

 

The Development Requires

excel