Forum


Replies: 5   Views: 3974
$docx->replacevariablebyhtml | parsedivsasps problem
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 cstolze  · 10-03-2015 - 10:11

Hi everybody, I have a problem with the function I mentioned in the topic. I use following code: $docx->replaceVariableByHTML('DATE_PROCESS_CONTENT', 'inline', ''.trim($date_process_content).'', array('isFile' => false, 'parseDivsAsPs' => true, 'downloadImages' => false)); The $date_process_content for example looks like: foreach (....) { $date_process_content.= '-div--b-'.trim($problemTypeName).'-/b--/div--div-'.$processDetails['notes'].'-/div-'; } The generated worddocument does not have any paragraphs, not even a line break. It works only with the br- tag, but than the word document have just linebreak, not paragraphs. I tried also block instead of inline with no effects. Any idea? Thank you.

Posted by admin  · 10-03-2015 - 11:36

Hello, Please run one of the included replaceVariableByHTML examples and check the output. Is Tidy installed and enabled? In your code we see: $date_process_content.= '-div--b-'.trim($problemTypeName).'-/b--/div--div-'.$processDetails['notes'].'-/div-'; But there's no valid tag. I don't know if the copy/paste has removed something, but there're only - instead of tag symbols. Regards.

Posted by cstolze  · 10-03-2015 - 13:45

I put the - instead of the tag symbol, because the forum doesn't show the tags normaly if I use them and also I couldn't find a preview function. The Tags in the code are correct. About Tidy: Where I can find this. I don't think we have it.

Posted by admin  · 10-03-2015 - 14:53

Hello, Tidy is a PHP extension. You can read more info about Tidy on: http://php.net/manual/es/book.tidy.php Regards.

Posted by cstolze  · 10-03-2015 - 15:27

According to my phpinfo output its installed, other ideas ?

Posted by admin  · 10-03-2015 - 15:39

Hello, As asked in a previous comment, please run one of the included replaceVariableByHTML examples and check if output is ok. Regards.