Download the PHP package idci/exporter-bundle without Composer

On this page you can find all versions of the php package idci/exporter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package exporter-bundle

ExporterBundle

Symfony2 exporter bundle

Installation

To install this bundle please follow the next steps:

First add the dependency in your composer.json file:

Then install the bundle with the command:

Enable the bundle in your application kernel:

Now the Bundle is installed.

How to use

First declare which entities can be exported in your config.yml:

By default, the export use twig engine to create exported files. We will see later that you can create your own transformer. For the moment create a directory in YourBundle/Resources/exporter/EntityName. Then create the needed templates which convert your entity into a specific format (csv, ics, json, xml for the moment) like this

Within your template you should usually use the twig variable entity such as {{ entity.id }}.

Finaly simply use the service as follow to export your entities into the given format:

This will return an Export object which contain the exported data.

To get the mime type format

Advanced configuration

You can customize entities transformers for each format. By default, idci_exporter.transformer_twig service is used to transform you entity. To use an other tranformer, create your own service which implements TransformerInterface.php and then associated it with a specific format like this:

If you want to change the TwigTransformer template path or the template name, you can use specified some transformer options:

By default template path is looking in the entity bundle dir Resources/exporter/EntityName/. And the template name format looks like export.%s.twig with %s replaced by the format (ex: xml, json, csv, ...).

How to export in jsonp format

If you already have a json export, it will be very easy to export into jsonp format. Simply add a new format and set the template_name options to export.json.twig:

So just add theses in your config.yml:

Use the API

This bundle help you to get your entities in a given format via HTTP requests. To do that, add its controller in the app/config/routing.yml like this:

Then you will be able to send request to the following routes:

exporter_api_norewrite            ANY    /api/query
exporter_api                      ANY    /api/{entity_reference}.{_format}

{entity_reference} is a required parameter. This is the value which is define in your config.yml:

If you get a UndefinedExportableEntityException this mean that you don't have well defined the export config for your Entity (The url might not match the entity_reference parameter for example).

Then you have to create an extract function in your EntityRepository which return a DoctrineCollection. This function get $params variable as arguments which can be used to filters your results.

Here is an example:

Now you can query your entities like this:

http://mydomaine/api/query?entityReference=my_entity_reference&format=xml

or

http://mydomaine/api/my_entity_reference.xml

All versions of exporter-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
symfony/framework-bundle Version >=2.1
twig/twig Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package idci/exporter-bundle contains the following files

Loading the files please wait ....