News
Getting the PHPDocX template variables from a Word template
- Jun 06, 2011
When using a Word template in PHPDocX you may need at certain point to get a list of all its placeholder variables.
You can recover, with the help of the getTemplateVariables method, all template variables as follows:
require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
// Select the template you want to use
$docx->addTemplate('../files/TemplateText.docx');
// Recover the template's variables.
print_r($docx->getTemplateVariables());