Forum


Replies: 3   Views: 3111
Createtemplate.returnallvariables is not returning all variables
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 fonfi  · 11-04-2013 - 12:13

I am having the same issue. Some docx templates have a lot of tags, therefore the last part of following condition:
[code]
if ($i == 0 || $i == count($documentSymbol) || $documentSymbolValue[0] == '<')
[/code]

is almost always true.
I modified the code in similar way as mquadrat:
[code]
$documentSymbol = explode(self::$_templateSymbol, self::$_document);
foreach ($documentSymbol as $i => $documentSymbolValue)
{
if ($i % 2 != 0)
$variables['document'][] = strip_tags($documentSymbolValue);
}
[/code]

Please let us know what was the reason you prepared the condition in such form, so we can be sure that our modifications won't break other functionality?

I am using latest PHPDocx PRO version 2.7