The ExportBundle gives you the chance to export CSV files (or other file types when implementing more factories) in your Symfony2 application.
This bundle requires Symfony 2.3+ and PHP 5.3.2+
Installation is simple:
- Download BlueteaExportBundle using composer
- Enable the Bundle
- Configure the BlueteaExportBundle
- Update your database schema
Add BlueteaExportBundle by running the command:
$ php composer.phar require bluetea/export-bundle '~1.1'
Composer will install the bundle to your project's vendor/bluetea
directory.
Enable the bundle in the kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Bluetea\ExportBundle\BlueteaExportBundle(),
);
}
Add the following configuration to your config.yml
file.
# app/config/config.yml
bluetea_export:
export_class: Bluetea\ExportBundle\Entity\Export
If you like to implement your own entities, read the extend entities documentation.
If you haven't enabled doctrine auto mapping, add BlueteaExportBundle
to your mappings.
Now that the bundle is configures, the last thing you need to do is update your database schema
because the bundle adds the Export and ExportLog entity. If you're using your own entities you
should exclude the BlueteaExportBundle
entities.
Run the following command.
$ php app/console doctrine:schema:update --force
If you're using the Doctrine migration bundle, run:
$ php app/console doctrine:migrations:diff
Now you're ready to use the BlueteaExportBundle!