Forum


Replies: 2   Views: 2758
Addfooter 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 admin  · 08-03-2017 - 07:14

Hello,

Your code has some errors. This is your code fixed:

$docx = new CreateDocx();
$default_footer = new WordFragment($docx, 'defaultFooter');
$default_footer->embedHTML($body);
$docx->addFooter(array('default' => $default_footer));

$docx->createDocxAndDownload($filename);

We recommend you to read the documentation available to know how to use the methods included in phpdocx:

http://www.phpdocx.com/documentation/practical

http://www.phpdocx.com/api-documentation/layout-and-general/insert-footers-Word-document-with-PHP

Regards.