PHPackages                             tecno/wordbundle - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. tecno/wordbundle

ActiveSymfony-bundle[File &amp; Storage](/categories/file-storage)

tecno/wordbundle
================

This is a Symfony2 Bundle helps you to read and write Word files (including odt, rtf), thanks to the PHPWord library

014PHP

Since May 30Pushed 11y ago1 watchersCompare

[ Source](https://github.com/Tecno-Soluciones/wordbundle)[ Packagist](https://packagist.org/packages/tecno/wordbundle)[ RSS](/packages/tecno-wordbundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony2 Excel bundle
=====================

[](#symfony2-excel-bundle)

[![Build Status](https://camo.githubusercontent.com/70f4697cd1fc0bdb140ea96196cdef3da34f33c4fca0163307efc1659d6800fe/68747470733a2f2f7472617669732d63692e6f72672f6c69756767696f2f457863656c42756e646c652e706e67)](https://travis-ci.org/liuggio/ExcelBundle)[![Total Downloads](https://camo.githubusercontent.com/664026f1957d190ccbda6f5696da9000b97cf117d376150bcd11e16d8c2f1c10/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f457863656c42756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/liuggio/ExcelBundle)[![Latest Stable Version](https://camo.githubusercontent.com/82b01663133dd13d1e8356926263311de29b89a43f2e0c642f05e0970ed38445/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f457863656c42756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/liuggio/ExcelBundle)[![Latest Unstable Version](https://camo.githubusercontent.com/15e7b9316925469b8b28949cd698a28c3dff3ba23b73182d9523e4bea4399cf6/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f457863656c42756e646c652f762f756e737461626c652e706e67)](https://packagist.org/packages/liuggio/ExcelBundle)

This bundle permits you to create an easily modifiable excel object.

Version 2
---------

[](#version-2)

This is the **shiny** new version. There is a big BC with the 1.\* version, but **unit tests**, **functional tests**, and **the new factory** is very simple to use.

### Version 1.\*

[](#version-1)

If you have installed an old version, and you are happy to use it, you could find documentation and files in the [tag v1.0.6](https://github.com/liuggio/ExcelBundle/releases/tag/v1.0.6), [browse the code](https://github.com/liuggio/ExcelBundle/tree/cf0ecbeea411d7c3bdc8abab14c3407afdf530c4).

### Things to know:

[](#things-to-know)

CSV is faster so if you have to create simple xls file, I encourage you to use the built-in function for csv: [http://php.net/manual-lookup.php?pattern=csv&amp;lang=en&amp;scope=quickref](http://php.net/manual-lookup.php?pattern=csv&lang=en&scope=quickref)

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

[](#installation)

**1** Add to composer.json to the `require` key

```
    "require" : {
        "liuggio/excelbundle": "~2.0",
    }
```

**2** Register the bundle in `app/AppKernel.php`

```
    $bundles = array(
        // ...
        new Liuggio\ExcelBundle\LiuggioExcelBundle(),
    );
```

TL;DR
-----

[](#tldr)

- Create an empty object:

```
$phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();
```

- Create an object from a file:

```
$phpExcelObject = $this->get('phpexcel')->createPHPExcelObject('file.xls');
```

- Create a Excel5 and write to a file given the object:

```
$writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');
$writer->save('file.xls');
```

- Create a Excel5 and create a StreamedResponse:

```
$writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');
$response = $writer->createStreamedResponse($writer);
```

Not Only 'Excel5'
-----------------

[](#not-only-excel5)

The list of the types are:

1. 'Excel5'
2. 'Excel2007'
3. 'Excel2003XML'
4. 'OOCalc'
5. 'SYLK'
6. 'Gnumeric'
7. 'HTML'
8. 'CSV'

Example
-------

[](#example)

### Fake Controller

[](#fake-controller)

The best place to start is the fake Controller at `Tests/app/Controller/FakeController.php`, that is a working example.

### More example

[](#more-example)

You could find a lot of examples in the official PHPExcel repository

### For lazy devs

[](#for-lazy-devs)

```
namespace YOURNAME\YOURBUNDLE\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{

    public function indexAction($name)
    {
        // ask the service for a Excel5
       $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();

       $phpExcelObject->getProperties()->setCreator("liuggio")
           ->setLastModifiedBy("Giulio De Donato")
           ->setTitle("Office 2005 XLSX Test Document")
           ->setSubject("Office 2005 XLSX Test Document")
           ->setDescription("Test document for Office 2005 XLSX, generated using PHP classes.")
           ->setKeywords("office 2005 openxml php")
           ->setCategory("Test result file");
       $phpExcelObject->setActiveSheetIndex(0)
           ->setCellValue('A1', 'Hello')
           ->setCellValue('B2', 'world!');
       $phpExcelObject->getActiveSheet()->setTitle('Simple');
       // Set active sheet index to the first sheet, so Excel opens this as the first sheet
       $phpExcelObject->setActiveSheetIndex(0);

        // create the writer
        $writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');
        // create the response
        $response = $this->get('phpexcel')->createStreamedResponse($writer);
        // adding headers
        $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');
        $response->headers->set('Content-Disposition', 'attachment;filename=stream-file.xls');
        $response->headers->set('Pragma', 'public');
        $response->headers->set('Cache-Control', 'maxage=1');

        return $response;
    }
}
```

Contributors
------------

[](#contributors)

the [list of contributors](https://github.com/liuggio/ExcelBundle/graphs/contributors)

Contribute
----------

[](#contribute)

1. fork the project
2. clone the repo
3. get the coding standard fixer: `wget http://cs.sensiolabs.org/get/php-cs-fixer.phar`
4. before the PullRequest you should run the coding standard fixer with `php php-cs-fixer.phar fix -v .`

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c97b998c5a89ec187a7857c973f0eb82796bf55de3ec20be8fbac34c590703ad?d=identicon)[desarrollotecno](/maintainers/desarrollotecno)

### Embed Badge

![Health badge](/badges/tecno-wordbundle/health.svg)

```
[![Health](https://phpackages.com/badges/tecno-wordbundle/health.svg)](https://phpackages.com/packages/tecno-wordbundle)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
