Пример #1
0
 /**
  * Write date.
  *
  * @link http://www.datypic.com/sc/ooxml/t-w_CT_SdtDate.html
  * @param \PhpOffice\Common\XMLWriter $xmlWriter
  * @param \PhpOffice\PhpWord\Element\SDT $element
  * @return void
  */
 private function writeDate(XMLWriter $xmlWriter, SDTElement $element)
 {
     $type = $element->getType();
     $xmlWriter->startElement("w:{$type}");
     $xmlWriter->writeElementBlock('w:dateFormat', 'w:val', 'd/M/yyyy');
     $xmlWriter->writeElementBlock('w:lid', 'w:val', 'en-US');
     $xmlWriter->writeElementBlock('w:storeMappedDataAs', 'w:val', 'dateTime');
     $xmlWriter->writeElementBlock('w:calendar', 'w:val', 'gregorian');
     $xmlWriter->endElement();
     // w:date
 }
Пример #2
0
 /**
  * Test set type
  */
 public function testSetTypeNull()
 {
     $object = new SDT('comboBox');
     $object->setType(' ');
     $this->assertEquals('comboBox', $object->getType());
 }