M
M
marq2020-05-12 21:21:45
PHP
marq, 2020-05-12 21:21:45

How to populate a template from ckeditor using PHPWord?

Good afternoon, is there a document template how to fill it with formatted text, and not with a regular string?

$document = new \PhpOffice\PhpWord\TemplateProcessor('templates/temp.docx');
$html =$_POST['txt'];
$document->setValue('name', \PhpOffice\PhpWord\Shared\Html::addHtml($section, $html, false, false)); //может так  можно?
//$document->setValue('name', 'Имя'); 
$document->saveAs('docs/Templl.docx',"Word2007");

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question