Quantcast
Channel: PHPWord
Viewing all articles
Browse latest Browse all 450

Commented Unassigned: setValue() not working [57]

$
0
0
here is my php code:
```
$PHPWord = new PHPWord();
$template = $PHPWord->loadTemplate(APPPATH.'files/test.docx');
$template->setValue('test1', 'hello');
$template->setValue('test2', 'whats');
$template->setValue('test3', 'up');
$template->setValue('test4', 'koby');
$template->setValue('test5', '!!!!!!');
$template->save('files/test.docx');
```

here is my word document text:

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

The output word content:

hello
${test2}
${test3}
${test4}
${test5}

setValue(); only sets the value for the first line ${test1}

Any help would be great
Comments: Please vote if this was helpful or solved your problem.

Viewing all articles
Browse latest Browse all 450

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>