Forum


Replies: 1   Views: 1954
Addtemplatevariable isn't working
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 numeric  · 21-12-2011 - 07:08

So I'm using templates and template variables to customize some documents. However, it's not working. Specifically, I have the following template variables that are in my docx file:

s.$ISEVARONE$=s.$ISPROPONE$="hockey stick";
s.events="$ISEVENTONE$";

I am then using the following code to replace these values:

[code]$docx = new CreateDocx();
$docx->addTemplate('test.docx');
$docx->addTemplateVariable('ISEVARONE','eVar1');
$docx->addTemplateVariable('ISPROPONE','prop1');
$docx->addTemplateVariable('ISEVENTONE','event1');
$docx->createDocx("test2");[/code]

When I do this, it doesn't change a thing in the file. I can't figure out what it is. Has anyone seen the same issues, and if so, do you have a work around or resolution? Any help would be great! Thanks!