Таблица с динамическим количеством строк в phpword (Laravel-templateprocessor) - PullRequest
0 голосов
/ 10 мая 2019

Можно ли создать таблицу с динамическими строками?

Я хотел бы знать, как можно вставить больше строк в таблицу, уже помещенную в шаблон.

FileWordController.php (Laravel)

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class FileWordController extends Controller
{
    public function crearWordDocx(){
        $templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor(Storage_path('template.docx'));
        $title = "Warehouse";
        $templateProcessor->setValue('title_company',$title);
        $templateProcessor->saveAs('Document02.docx');
        header("Content-Disposition: attachment; filename=Document02.docx; charset=iso-8859-1");
        echo file_get_contents("Document02.docx");
    }
}
...