Hello again,
thank you for your fast reply.
To be honest, I've tried your solution some days ago without any success!
Using the key "target" I was able to achieve my result but only if I replace this
$docx = new CreateDocx();
$docx->importHeadersAndFooters('footerheader.docx');
with this
$docx = new CreateDocxFromTemplate('footerheader.docx');
The footerheader.docx is just a void body template with header&footer (header img, footer test,pagination and 1 variable)
I don't know if this is a bug/mistake/something that afflicts 4.1 but after I import header and footer with "importHeadersAndFooters" I cannot use anymore replacevariablebytext (and this is why I asked for fragment too).
Do you think I can use my solution ( using " CreateDocxFromTemplate") or I have to find a workaround to implement importHeadersAndFooters anyway ?
I really appreciate your help.
I hope to hear from you soon