addParagraphStyle('pStyle', array('alignment' => Jc::START)); $section = $phpWord->addSection(); $section->addText(htmlspecialchars('Text', ENT_COMPAT, 'UTF-8')); $footnote1 = $section->addFootnote('pStyle'); $footnote1->addText(htmlspecialchars('Footnote', ENT_COMPAT, 'UTF-8')); $footnote1->addTextBreak(); $footnote1->addLink('https://github.com/PHPOffice/PHPWord'); $footnote2 = $section->addEndnote(array('alignment' => Jc::START)); $footnote2->addText(htmlspecialchars('Endnote', ENT_COMPAT, 'UTF-8')); $doc = TestHelperDOCX::getDocument($phpWord); $this->assertTrue($doc->elementExists('/w:document/w:body/w:p/w:r/w:footnoteReference')); $this->assertTrue($doc->elementExists('/w:document/w:body/w:p/w:r/w:endnoteReference')); } }