當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XMLWriter::writeElementBlock方法代碼示例

本文整理匯總了PHP中PhpOffice\PhpWord\Shared\XMLWriter::writeElementBlock方法的典型用法代碼示例。如果您正苦於以下問題:PHP XMLWriter::writeElementBlock方法的具體用法?PHP XMLWriter::writeElementBlock怎麽用?PHP XMLWriter::writeElementBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhpOffice\PhpWord\Shared\XMLWriter的用法示例。


在下文中一共展示了XMLWriter::writeElementBlock方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: writeAxis

 /**
  * Write axis
  *
  * @link http://www.datypic.com/sc/ooxml/t-draw-chart_CT_CatAx.html
  * @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
  * @param string $type
  * @return void
  */
 private function writeAxis(XMLWriter $xmlWriter, $type)
 {
     $types = array('cat' => array('c:catAx', 1, 'b', 2), 'val' => array('c:valAx', 2, 'l', 1));
     list($axisType, $axisId, $axisPos, $axisCross) = $types[$type];
     $xmlWriter->startElement($axisType);
     $xmlWriter->writeElementBlock('c:axId', 'val', $axisId);
     $xmlWriter->writeElementBlock('c:axPos', 'val', $axisPos);
     $xmlWriter->writeElementBlock('c:crossAx', 'val', $axisCross);
     $xmlWriter->writeElementBlock('c:auto', 'val', 1);
     if (isset($this->options['axes'])) {
         $xmlWriter->writeElementBlock('c:delete', 'val', 0);
         $xmlWriter->writeElementBlock('c:majorTickMark', 'val', 'none');
         $xmlWriter->writeElementBlock('c:minorTickMark', 'val', 'none');
         $xmlWriter->writeElementBlock('c:tickLblPos', 'val', 'none');
         // nextTo
         $xmlWriter->writeElementBlock('c:crosses', 'val', 'autoZero');
     }
     if (isset($this->options['radar'])) {
         $xmlWriter->writeElement('c:majorGridlines');
     }
     $xmlWriter->startElement('c:scaling');
     $xmlWriter->writeElementBlock('c:orientation', 'val', 'minMax');
     $xmlWriter->endElement();
     // c:scaling
     $this->writeShape($xmlWriter, true);
     $xmlWriter->endElement();
     // $axisType
 }
開發者ID:doit05,項目名稱:relProject,代碼行數:36,代碼來源:Chart.php

示例2: writeDropDown

 /**
  * Write dropdown.
  *
  * @link http://www.datypic.com/sc/ooxml/t-w_CT_FFDDList.html
  * @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
  * @param \PhpOffice\PhpWord\Element\FormField $element
  * @return void
  */
 private function writeDropDown(XMLWriter $xmlWriter, FormFieldElement $element)
 {
     $default = $element->getDefault();
     $value = $element->getValue();
     if ($value == null) {
         $value = $default;
     }
     $entries = $element->getEntries();
     $xmlWriter->startElement('w:ddList');
     $xmlWriter->writeElementBlock('w:result', 'w:val', $value);
     $xmlWriter->writeElementBlock('w:default', 'w:val', $default);
     foreach ($entries as $entry) {
         $xmlWriter->writeElementBlock('w:listEntry', 'w:val', $entry);
     }
     $xmlWriter->endElement();
 }
開發者ID:Senasum,項目名稱:PHPWord,代碼行數:24,代碼來源:FormField.php

示例3: writeDate

 /**
  * Write date.
  *
  * @link http://www.datypic.com/sc/ooxml/t-w_CT_SdtDate.html
  * @param \PhpOffice\PhpWord\Shared\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
 }
開發者ID:doit05,項目名稱:relProject,代碼行數:19,代碼來源:SDT.php


注:本文中的PhpOffice\PhpWord\Shared\XMLWriter::writeElementBlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。