Forum


Replies: 3   Views: 4274
Problems with variable replacement
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by campagnuolo  · 18-11-2015 - 08:32

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