phpword foreach one word save as

Solutions on MaxInterview for phpword foreach one word save as by the best coders in the world

showing results for - "phpword foreach one word save as"
Maxim
11 May 2020
1<?php
2require './modules/vendor/autoload.php';
3$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor(__DIR__ . '/wordfile.docx');
4foreach ($tashkilot as $itemtwo) {
5    $replacements[] = [
6        'country' => $itemtwo->no,
7        'date' => $itemtwo->sana,
8    ];
9}
10
11if (!file_exists(UPLOAD_PATH . '/folder/' . $nomi->chiqnm . " " . shaklqisqa($nomi->chiqsh, $nomi->chiqnm) . '.docx')) {
12    $templateProcessor->cloneBlock('nameblock', 0, true, false, $replacements);
13    $templateProcessor->saveAs(UPLOAD_PATH . '/folder/' . $nomi->chiqnm . " " . shaklqisqa($nomi->chiqsh, $nomi->chiqnm) . '.docx');
14}