나는 phpdocx를 사용하여 단어 문서를 생성한다.phpdocx wordfragment가 작동하지 않는 템플릿 헤더 변수를 바꾼다
동적으로 머리글을 단어로 변경했습니다. 그래서 헤더 변수를 대명하게 대체하고 싶습니다. 그들이 그것을 WordFragment 방법을 사용하여 수행 할 수 있지만 작동하지 말 phpdocx 포럼 .. 여기 http://www.zxcv.phpdocx.com/en/forum/default/topic/734
내 코드는 내가 헤더에 $ TESTTT $ 변수를 넣어
//path to the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocxFromTemplate('Doc.docx');
//create the Word fragment that is going to replace the variable
$wf = new WordFragment($docx, 'document');
$text='try to add head';
$wf->addText($text);
$docx->replaceVariableByWordFragment(array('TESTTT' => $wf), array('type' => 'block'));
$docx->createDocx('tessst');
와 협력하고 당신은 phpdocx 포럼에 요청해야 – Sal00m
난 빠르게 확인할 수있는 온라인 API 문서에 오류가 내가 발견 한 오류이 –