Forum


Replies: 2   Views: 3687
Can't get any html replacement methods to work.
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 besmithinc  · 23-12-2014 - 14:57

I have the pro license and I've added the path to CreateDocX.inc ... require_once('/sites/all/modules/toolkit_engagement/includes/phpdocx/classes/CreateDocx.inc'); But when I do $docx = new CreateDocx(); $docx->addTemplate('path to template.docx'); I get: Call to undefined method CreateDocx::addTemplate() I can however do: $docx = new CreateDocxFromTemplate($_SERVER['DOCUMENT_ROOT']. '/includes/templates/meetingTemp.docx'); and it will work, but then I get an undefined method error when I try to do: $docx->replaceTemplateVariableByHTML('MEETINGSCHEDULE', 'inline', $html); Any idea why I can't use ANY of the methods used in the documentation on swapping variables with html?

Posted by admin  · 23-12-2014 - 15:03

Hello, Phpdocx 4 uses a new API with new methods. AddTemplate and replaceTemplateVariableByHTML are from phpdocx 3.7. Please check the API page: http://www.phpdocx.com/documentation/api-documentation and the included examples in your package. Regards.