/** * Read text. * * @return void */ private function readText() { $text = $this->textrun->addText($this->text); if (isset($this->flags['styles']['font'])) { $text->getFontStyle()->setStyleByArray($this->flags['styles']['font']); } }
/** * Add footnote */ public function testCreateFootnote() { $oTextRun = new TextRun(); $oTextRun->setPhpWord(new PhpWord()); $element = $oTextRun->addFootnote(); $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Footnote', $element); $this->assertCount(1, $oTextRun->getElements()); }
/** * Add textrun element * * @param mixed $paragraphStyle * @return TextRun */ public function addTextRun($paragraphStyle = null) { $this->checkValidity('textrun'); $textRun = new TextRun($paragraphStyle); $textRun->setDocPart($this->getDocPart(), $this->getDocPartId()); $this->addElement($textRun); return $textRun; }