Download the PHP package alhimik1986/php-excel-templator without Composer

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

Please rate this library. Is it a good library?
Rate from 1 - 5
Rated 5.00 based on 2 reviews

All versions of php-excel-templator with dependencies

Informations about the package php-excel-templator

PHP Excel Templator

Latest Stable Version Latest Unstable Version License Total Downloads Monthly Downloads Daily Downloads

Инструкция на русском языке (Russian)

It's PHP Spreadsheet extension that allows you to export excel files from an excel template. Using the extension you don’t need to create excel files from scratch using code, set styles and so on.

Demo screenshot:

Simple example

There is a simplest example of how this might look (using less code). Suppose we have an excel file with the following template variables:

The code will be as follows:

As a result, we get:

Using this extension, we just create a template file with the styles we need and specify template variables in it. In the code, we just pass the parameters to template variables.


Features demo and usage examples are given in the folder "samples".



Template variable naming rules

The rules can be any, but I can offer my recommendation for naming template variables:

How to insert a one-dimensional array, so that the table create columns, not rows?

To do this, instead of a one-dimensional array, insert a two-dimensional one as follows:

Using setters

In the example above, the minimum code without setters was used. The data types (for example: a string, a one-dimensional array, or a two-dimensional array) in this code is automatically recognized and the necessary setter is chose. But if we want to use a specific setter, the same code will look like this:

At the moment the extension has 3 kinds of setters:

You ask, what for specify setters explicitly?

Examples of code that uses all kinds of setters are listed in the folder "samples".

How to set styles without setters?

In most cases to use the setters explicitly is not so convenient. I suppose you want to use minimum code. Therefore, I made it possible to set styles without using setters:

Special setter for special templates (CellSetterArrayValueSpecial)

There are special templates, which require to insert the whole row, and not insert cell with shifting down. Moreover, it's required to merge cells, as well as the cell in which there was a template variable.

For these templates, a special setter has been created: CellSetterArrayValueSpecial. Examples of code that uses it is given in folder: samples/8_special_template.


The following are possible events and an explanation of why they can be applied:

Requires php Version >=7.2
phpoffice/phpspreadsheet Version >=1.4

The package alhimik1986/php-excel-templator contains the following files

Loading the files please wait ....

Continue with your Google account.