Forum


Replies: 3   Views: 3128
Replacetemplatevariablebyhtml() bug
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 jens.grasnick  · 20-04-2014 - 18:39

Hi,



just want to inform you that if you pass a empty or null value as $html parameter to replaceTemplateVariableByHTML() method, you'll get a fatal error. It would be fine if the library detect such values for its own and redirect to addTemplateVariable($var, '').


Posted by jorgelj  · 21-04-2014 - 09:18

Hi,



The parameter $html is required, so we recommend you to do check the value and use one or other method if the $html has value or not.



Regards.


Posted by jens.grasnick  · 21-04-2014 - 13:14

Hi jorgelj,



thanks for your fast reply. Basically, you are right but it would be a neat feature if this check would be done by the method once, instead of forcing all programmers to do it everytime a value passed to a variable (especially if you pass database values to the library, which can be null or empty).



Regards.