Forum


Replies: 2   Views: 5081
Addtemplatehtml
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 brieflogic  · 13-08-2011 - 14:05

It would be spectacular if phpdocx could replace a template variable with HTML.

Similar to addHTML, but with replacing variables in a template.

Posted by admin  · 11-04-2013 - 12:13

Hello,

You can replace a placeholder with HTML using addTemplateVariable method:

$docx->addTemplateVariable('NAME',
'<strong>David Hume</strong><br />
<em>Character is the result of a system of stereotyped principles.</em>',
'html');

Please check easy/TemplateHTML.php example included in phpdocx pro.

Regards.