首页 新闻 赞助 找找看

PhpWord模板的保存

0
悬赏园豆:50 [已关闭问题] 关闭于 2019-07-16 11:24

$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中呢.

不喜欢酸甜的刘青阳的主页 不喜欢酸甜的刘青阳 | 菜鸟二级 | 园豆:202
提问于:2019-07-16 11:04
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册