Forum


Replies: 2   Views: 2610
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 repunge  · 08-03-2017 - 03:21

Hi. I try to add footer to embedHTML but I do not see anything. Footer doesn't appear. Any idea. Here is example: 

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

$docx->createDocxAndDownload($filename);

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.

Posted by repunge  · 08-03-2017 - 10:08

I see now. Thx