I load a template and replace a variable from an external file in it. The external file also contains this variable, but I can't replace it again.
Code example:
$docx = new \CreateDocxFromTemplate('nds.docx');
$docx->setTemplateSymbol('[', ']');
$docx->replaceVariableByExternalFile(['nds_cert' => 'nds2.docx'], ['matchSource' => true]);
$docx->replaceVariableByText(['nds_cert' => 'bbb '], ["firstMatch" => false]);
$docx->CreateDocx('nds3.docx');
File contents.
nds.docx:
[nds_cert]
nds2.docx:
Aaaa
[nds_cert]
I get the output
nds3.docx:
Aaaa
[nds_cert]
How to get in the file nds3.docx
Aaaa
bbb
?