PhpWord doesn't replace text

前端 未结 7 1786
闹比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 09:58

    I found the solution in http://phpword.codeplex.com/workitem/57... the problem seems to be when word generates his own code.

    for the solution, just rename extension your template to zip, check in a file named 'document.xml' into 'word' folder, and search your code value... it should be like this:

    
    
        
            
                
                    ${test1}
                
            
            
                
                    ${test2}
                
            
            
                
                    ${test3}
                
            
            
                
                    ${test4}
                
            
            
                
                    ${
                
                
                
                
                    test5}
                
            
            
                
                
                
                
            
        
    
    

提交回复
热议问题