PhpWord doesn't replace text

前端 未结 7 1784
闹比i
闹比i 2021-02-14 09:34

I have a docx file and I need to replace some text. This is done inside codeigniter framework; here is the code:

$this->load->library(\'word\');       
$te         


        
7条回答
  •  盖世英雄少女心
    2021-02-14 10:11

    here i try and working well,

    setValue function does not work because it include the format of word after generate to web. so the text you might replace not found.

    the solution is just type your ${replaceKey} to notepad and copy it to your_template.docx it working for me.

    notepad make all word format not included to the template so the function setValue can found it as expected.

    Hope it Helping you guys.

提交回复
热议问题