Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: replace keywords of word #1406

Open
rommer-luo opened this issue Jun 7, 2018 · 4 comments
Open

error: replace keywords of word #1406

rommer-luo opened this issue Jun 7, 2018 · 4 comments

Comments

@rommer-luo
Copy link

image

Could not copy 'payment.docx' file to 'C:\Windows\Temp\PhpABD2.tmp'.

错误位置
FILE: D:\wamp64\www\sample\ThinkPHP\Library\Vendor\PHPWord\src\PhpWord\TemplateProcessor.php  LINE: 83

TRACE
#0 D:\wamp64\www\sample\Application\Home\Controller\PaymentManagementController.class.php(118): PhpOffice\PhpWord\TemplateProcessor->__construct('payment.docx')
#1 [internal function]: Home\Controller\PaymentManagementController->downPaymentLetter()
#2 D:\wamp64\www\sample\ThinkPHP\Library\Think\App.class.php(164): ReflectionMethod->invoke(Object(Home\Controller\PaymentManagementController))
#3 D:\wamp64\www\sample\ThinkPHP\Library\Think\App.class.php(202): Think\App::exec()
#4 D:\wamp64\www\sample\ThinkPHP\Library\Think\Think.class.php(121): Think\App::run()
#5 D:\wamp64\www\sample\ThinkPHP\ThinkPHP.php(97): Think\Think::start()
#6 D:\wamp64\www\sample\index.php(25): require('D:\wamp64\www\s...')
#7 {main}

my code:
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor('payment.docx');
$templateProcessor->setValue('company', 'hahha');
$templateProcessor->setValue('money', 'hahha');
$templateProcessor->saveAs(ROOT.'/8888888888888888.docx');

so,I don't konw how to do?thank you

@rommer-luo
Copy link
Author

How to use it in the thinkPHP3.2 framework.
Can you give me a case?
thank you

@kevinfei520
Copy link

kevinfei520 commented Jun 7, 2018 via email

@cxkking
Copy link

cxkking commented Jun 21, 2018

请问thinkphp 使用phpword replace 的问题解决了吗 我也遇到了这个问题 求助大家

@rommer-luo
Copy link
Author

@cxkking 因为tp3.2 默认的类文件都是.class.php结尾的,所以引入的时候会有问题的,要么就是找到引入的地方,修改引入的文件的尾部标志。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants