I want to add footer to my created document, how can i do this with phpword?
My template processing code:
$template = new \PhpOffice\PhpWord\TemplateProcessor("my-template.docx");
$table = new \PhpOffice\PhpWord\Element\Table();
$table->addRow();
$table->addCell()->addText("test");
$template->setComplexBlock('table_var', $table);
$template->saveAs("new-file.docx");
As mentioned in another post, first save your template, and then open the result again like:
Then, if your template does not have any footer, add one like:
Or, you can edit existing footer like: