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.