是否可以创建带有动态行的表?
我想知道如何在已经放置在模板中的表中插入更多行。
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");
}
}