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/';

$docx = new CreateDocx();

// Select the template you want to use

// Recover the template's variables.