Download the PHP package kczer/excel-importer-bundle without Composer

On this page you can find all versions of the php package kczer/excel-importer-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 excel-importer-bundle

Table of contents

ExcelImporterBundle

ExcelImportedBundle enables PHP objects import from EXCEL files as well as export of the same objects.

Installation

You can install it with composer like so:

Documentation

Sample import model- @ExcelColumn annotation:

First, we need to create model that will represent EXCEL file content. Here we use @ExcelColumn annotation with following options:

Sample import - model (Technical keys):

Sample model for EXCEL file would look like this:

Following EXCEL file would match this model:

Sample import - model (Named column keys):

The same model as above using named column keys would look like so:

Sample import - display model

Sometimes we would like to display some of imported content or see validation messages generated by importer. It can be achieved by creating display model class that extends AbstractDisplayModel class. Display model classes must have the same property names as model one (for all mapped fields) and have them declared as strings. Display model class for above model would look like so:

Thanks to extending AbstractDisplayModel class we have access to two methods:

Sample import

Model defined above can be imported via importing ModelExcelImporterFactory and creating ModelExcelImporter instance

Method parseExcelFile takes up two arguments:

Sample import - complex validation

Sometimes it is required to perform some more complex validation, for example validation between columns, when one cell should be dependent on others. Let's say that we want every name cell to end with corresponding id. It is achievable by calling setRowRequirementsValidator:

Sample import- useful methods

Here are some useful methods from importer:

Sample import- annotation validation

Bundle comes with two built-in validation available from model level:

Each validator has message property, that specifies error message when validation fails. These messages support translations and each validator passes specific translation parameters. Supported translation parameters

If we for example wanted name field to always end with id, and to be at most 10 characters long, we can type:

Sample export

Having our model we can not only import it from EXCEL file, but also export it and merge to existing EXCEL FILES.

There are two export methods:

AbstractDictionaryExcelCell

Dictionary EXCEL cells are used to define "range" of values, that cell can take. It's use when cell value must match some column value from database Sample DictionaryClass class:

Yaml configuration

Example below shows all available configuration options, that can be paced in _config/packages/kczer_excelimporter.yaml file:


All versions of excel-importer-bundle with dependencies

PHP Build Version
Package Version
Requires phpoffice/phpspreadsheet Version ^1.3
php Version >=8.0
ext-ctype Version *
ext-json Version *
doctrine/annotations Version ~1.0
symfony/dependency-injection Version >=3.3
symfony/config Version >=3.3
symfony/http-kernel Version >=3.3
symfony/yaml Version >=4.0
symfony/translation Version >=4.0
symfony/console Version >=4.4.0
symfony/twig-bundle Version >=4.4.0
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 kczer/excel-importer-bundle contains the following files

Loading the files please wait ....