Forum


Replies: 4   Views: 3951
Html content with addtable() method
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 Sven May  · 17-02-2015 - 10:18

Hello! I try to make a table therefore I use addTable() method. Inside the table...in a cell I need to suit a HTML content. I found a solution for it in documetation: http://www.phpdocx.com/introduction/html-to-word-PHP at HTML code embeded within a Word table. (Sorry! I misspelled in my first post) My problem is: when I do the generation I got the following PHP error message: Call to undefined method Phpdocx\Create\CreateDocx::createWordMLFragment() What I do wrong? I would like to avoid to build a HTML table! What I tried: suit the exmaple source code but it is not work :( Thanks!

Posted by admin  · 17-02-2015 - 11:07

Hello, If you need to replace a placeholder by HTML you need to used the replaceVariableByHTML method: http://www.phpdocx.com/api-documentation/templates/replace-variable-html-Word-document What method are you using that return the undefined method? Regards.

Posted by Sven May  · 17-02-2015 - 11:12

I am affraid i do not understand your question: What method are you using that return the undefined method? I create a docx object -> $docx = new new CreateDocx(); then $docx->createWordMLFragment() ...and this method was not found. I tried to run the example code what I found here! ( http://www.phpdocx.com/introduction/html-to-word-PHP at external HTML source part) This exempale not use replaceVariableByHTML() method. What I want: I have a HTML content and I have to suit it into a cell. The table is not a HTML table I use addTable() method to build it.

Posted by admin  · 17-02-2015 - 11:16

Hello, Our apologizes, that page seems to be outdated. You need to use the WordFragment class, please check the included examples within the package and read this page: http://www.phpdocx.com/practical/wordfragments-and-wordml We're going to fix that mistake in the documentation. Regards.

Posted by Sven May  · 17-02-2015 - 11:28

It is work fine! Thanks!