Ok. Thank you.
How to add a footer on each page? In my case, I am using sections as I've mentioned above. When I add a footer at the end of the code then the footer appears only on the last page. If I place the addFooter function in the very beginning, then the footer appears at each page but at the same time each section also starts from a new page.
$default = new WordFragment($docx, 'default');
$default->addText('default page footer.');
$docx->addFooter(array('default' => $default));