I am using phpdocx-premium-12.5-ns. I created a document with variables like %%variable%%, then I try the below code:
require_once 'classes/CreateDocx.php';
$docx = new CreateDocxFromTemplate('document.docx');
$docx->setTemplateSymbol('%%', '%%');
print_r($docx->getTemplateVariables());
But it does not return anything, if I add a variable like ${variable} it is returned as ${variable}
If I set the symbol $docx->setTemplateSymbol('${', '}') it works normally and returns the variable.
My question: how can I use this variable %%variable%% and use the %% as a template symbol to get all the existing variables?
As I checked in the code of 'CreateDocxFromTemplate.php' class they call extractVariablesDistinctSymbols where they preg_match this pattern only: \$(?:\{|[^{$]*\>\{)[^}$]*\}
i get the answer from phpdocx