Forum


Replies: 4   Views: 3208
How do you replace a $variable$ with wordml?
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 ephp027  · 29-09-2012 - 04:06

To try to get around slow table generation:

Say you add a variable like $VAR_TABLE$
create a table (addTable) and capture the WordML
replace $VAR_TABLE$ with the the WordML with addTemplateVariable --

How do you get the WordML to be inserted properly in the doc, and not show up as raw text?

Thank you.

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

Hello,

You can instanciate CreateTable class and get WordML; __toString magic method is used to get WordML of an element.

Regards.

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

Could you please share some sample code how to do that?

Thank you.

Posted by admin  · 12-04-2013 - 09:23

Hello,



Using the current version of PHPDocX you can use WordML fragment; please check included examples.



Regards.