You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
557 B
18 lines
557 B
<?php
|
|
|
|
class ArticleController
|
|
{
|
|
|
|
public function sendArticle()
|
|
{
|
|
$list = Article::field("*")->select()->toArray();
|
|
foreach($list as $value) {
|
|
dd(1231);
|
|
$content = json_decode(htmlspecialchars_decode($value['content']), true);
|
|
$tmp = new \PhpOffice\PhpWord\TemplateProcessor('tmp.docx');//打开模板
|
|
$tmp->setValue('name', '李四');//替换变量name
|
|
$tmp->setValue('mobile', '18888888888');//替换变量mobile
|
|
$tmp->saveAs('简历.docx');
|
|
}
|
|
}
|
|
}
|