php - 块的 phpword 库克隆正在本地主机上工作,但不适用于生产
问题描述
我正在尝试使用以下代码通过 PHPWORD 克隆“block_networth”块
require_once "./Classes/PHPWord/vendor/autoload.php";
header('Content-type: text/html; charset=utf-8');
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$templateProcessor = new
PhpOffice\PhpWord\TemplateProcessor('kcc_templates/kcc_crop_template.docx');
$templateProcessor->cloneBlock('block_networth',2, true, true);
模板文件中的块
${block_networth}
${test}
${/block_networth}
预期结果
test#1
test#2
实际结果
${block_networth}
${test}
${/block_networth}
解决方案
推荐阅读
- r - 如何解决错误消息“data.frame”并非都是 TRUE”
- azure - Azure 介绍问题
- sql - BigQuery:当没有什么可以加入时进行昂贵的全表扫描
- vue.js - Vue3,VeeValidate4 - 未捕获(承诺中)TypeError:无法读取未定义的属性“firstName”
- android - 无法从当前目的地找到导航操作/目的地
- laravel - Laravel Livewire 处理数据但不重新渲染
- javascript - 根据环境从 HTML 更改 URL
- c# - Clear with query in database access 97 mdb c#
- node.js - Nuxt 错误:请求失败,状态码为 503
- amazon-cloudwatch - 日志事件在 cloudstream 日志流中具有不同的颜色