Hello,
Please note that if the placeholders in the template are using ${ } as template symbols (instead of the default $), setTemplateSymbol must be called before any replacement method:
$docx = new CreateDocxFromTemplate($path);
$docx->setTemplateSymbol('${', '}');
(...)
$docx->replaceVariableByWordFragment...
Regards.