$PhpWord = new \PhpOffice\PhpWord\PhpWord();
$template = $PhpWord->loadTemplate('./shijuanstyle.docx');
header('pragma:public');
header('Content-type:application/vnd.ms-word;charset=utf-8;name="'.$data['title'].'.docx"');
header("Content-Disposition:attachment;filename=$fileName.docx");
ob_clean();
flush();
$objWrite = \PhpOffice\PhpWord\IOFactory::createWriter($PhpWord, 'Word2007');
$objWrite->save('php://output');
//createWriter方法不能直接提交$template,只能提交$PhpWord但是显示空白,怎样将赋值好的模板内容保存到$PhpWord中呢.