|
@@ -159,7 +159,6 @@ class Index extends Api
|
|
|
|
|
|
|
|
|
|
\PhpOffice\PhpWord\Settings::setZipClass(\PhpOffice\PhpWord\Settings::PCLZIP);
|
|
\PhpOffice\PhpWord\Settings::setZipClass(\PhpOffice\PhpWord\Settings::PCLZIP);
|
|
- // $tmp = new TemplateProcessor("20210709174526ccccccccc.docx");
|
|
|
|
$tmp=new \PhpOffice\PhpWord\TemplateProcessor('20210709174526ccccccccc.docx');//打开模板
|
|
$tmp=new \PhpOffice\PhpWord\TemplateProcessor('20210709174526ccccccccc.docx');//打开模板
|
|
$tmp->setValue('username',utf8_decode('李四'));//替换变量
|
|
$tmp->setValue('username',utf8_decode('李四'));//替换变量
|
|
$tmp->saveAs($_SERVER['DOCUMENT_ROOT']."/upload/123.docx");
|
|
$tmp->saveAs($_SERVER['DOCUMENT_ROOT']."/upload/123.docx");
|