当前位置: 首页>>代码示例>>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;未经允许,请勿转载。