Hello,
UPDATE: phpdocx 13.5 added getTemplateVariablesType to get the type of template variables.
Using getDocxPathQueryInfo you can query by many content types, such as list type, for example using the file TemplateList.docx included in the package:
$docx = new CreateDocxFromTemplate('examples/files/TemplateList.docx');
$referenceNode = array(
'type' => 'list',
);
$queryInfo = $docx->getDocxPathQueryInfo($referenceNode);
foreach ($queryInfo['elements'] as $element) {
var_dump($element->textContent);
}
You can iterate the elements key and get each value using the textContent attribute, that removes the tags to get the value of each result and returns the value of each list paragraph (in a DOCX a list is a paragraph with some specific w:numPr and w:ilvl tags). Using this code you can iterate the elements to get only those strings that contain the symbols uses to wrap the placeholders ($ as default).
Regards.