PHP code example of icircle / docx-template-in-php

1. Go to this page and download the library: Download icircle/docx-template-in-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

icircle / docx-template-in-php example snippets


use icircle\Template\Docx\DocxTemplate;

$docxTemplate = new DocxTemplate('path/to/template/file');
$dataArray = array() // fill the $dataArray with data
$docxTemplate->merge($dataArray,'path/to/output/file');