Exemplo n.º 1
0
 /**
  * Write note item
  *
  * @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
  * @param \PhpOffice\PhpWord\Element\Footnote|\PhpOffice\PhpWord\Element\Endnote $element
  */
 protected function writeNote(XMLWriter $xmlWriter, $element)
 {
     $xmlWriter->startElement($this->elementNode);
     $xmlWriter->writeAttribute('w:id', $element->getRelationId());
     $xmlWriter->startElement('w:p');
     // Paragraph style
     $styleWriter = new ParagraphStyleWriter($xmlWriter, $element->getParagraphStyle());
     $styleWriter->setIsInline(true);
     $styleWriter->write();
     // Reference symbol
     $xmlWriter->startElement('w:r');
     $xmlWriter->startElement('w:rPr');
     $xmlWriter->startElement('w:rStyle');
     $xmlWriter->writeAttribute('w:val', $this->refStyle);
     $xmlWriter->endElement();
     // w:rStyle
     $xmlWriter->endElement();
     // w:rPr
     $xmlWriter->writeElement($this->refNode);
     $xmlWriter->endElement();
     // w:r
     // Empty space after refence symbol
     $xmlWriter->startElement('w:r');
     $xmlWriter->startElement('w:t');
     $xmlWriter->writeAttribute('xml:space', 'preserve');
     $xmlWriter->writeRaw(' ');
     $xmlWriter->endElement();
     // w:t
     $xmlWriter->endElement();
     // w:r
     $this->writeContainerElements($xmlWriter, $element);
     $xmlWriter->endElement();
     // w:p
     $xmlWriter->endElement();
     // $this->elementNode
 }
Exemplo n.º 2
0
 /**
  * Get elements
  */
 public function testGetElements()
 {
     $oFootnote = new Footnote();
     $this->assertInternalType('array', $oFootnote->getElements());
 }