当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPWord::getProperties方法代码示例

本文整理汇总了PHP中PHPWord::getProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWord::getProperties方法的具体用法?PHP PHPWord::getProperties怎么用?PHP PHPWord::getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPWord的用法示例。


在下文中一共展示了PHPWord::getProperties方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: writeMeta

 /**
  * Write Meta file to XML format
  *
  * @param 	PHPWord $pPHPWord
  * @return 	string 						XML Output
  * @throws 	Exception
  */
 public function writeMeta(PHPWord $pPHPWord = null)
 {
     // Create XML writer
     $objWriter = null;
     if ($this->getParentWriter()->getUseDiskCaching()) {
         $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
     } else {
         $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY);
     }
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8');
     // office:document-meta
     $objWriter->startElement('office:document-meta');
     $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
     $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
     $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
     $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
     $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
     $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
     $objWriter->writeAttribute('office:version', '1.2');
     // office:meta
     $objWriter->startElement('office:meta');
     // dc:creator
     $objWriter->writeElement('dc:creator', $pPHPWord->getProperties()->getLastModifiedBy());
     // dc:date
     $objWriter->writeElement('dc:date', gmdate('Y-m-d\\TH:i:s.000', $pPHPWord->getProperties()->getModified()));
     // dc:description
     $objWriter->writeElement('dc:description', $pPHPWord->getProperties()->getDescription());
     // dc:subject
     $objWriter->writeElement('dc:subject', $pPHPWord->getProperties()->getSubject());
     // dc:title
     $objWriter->writeElement('dc:title', $pPHPWord->getProperties()->getTitle());
     // meta:creation-date
     $objWriter->writeElement('meta:creation-date', gmdate('Y-m-d\\TH:i:s.000', $pPHPWord->getProperties()->getCreated()));
     // meta:initial-creator
     $objWriter->writeElement('meta:initial-creator', $pPHPWord->getProperties()->getCreator());
     // meta:keyword
     $objWriter->writeElement('meta:keyword', $pPHPWord->getProperties()->getKeywords());
     // @todo : Where these properties are written ?
     // $pPHPWord->getProperties()->getCategory()
     // $pPHPWord->getProperties()->getCompany()
     $objWriter->endElement();
     $objWriter->endElement();
     // Return
     return $objWriter->getData();
 }
开发者ID:frankkoch,项目名称:moodle-mod_offlinequiz,代码行数:53,代码来源:Meta.php

示例2: obtenerActividadesPorEtapaFuncion

 $_actividades_etapa1 = obtenerActividadesPorEtapaFuncion($_etapas[0]['e_id_etapa'], $conexion);
 $_actividades_etapa2 = obtenerActividadesPorEtapaFuncion($_etapas[1]['e_id_etapa'], $conexion);
 $_actividades_etapa3 = obtenerActividadesPorEtapaFuncion($_etapas[2]['e_id_etapa'], $conexion);
 $totalEtapa1 = count($_actividades_etapa1);
 $totalEtapa2 = count($_actividades_etapa2);
 $totalEtapa3 = count($_actividades_etapa3);
 $maxActividades = $totalEtapa1;
 if ($totalEtapa2 > $maxActividades) {
     $maxActividades = $totalEtapa2;
 }
 if ($totalEtapa3 > $maxActividades) {
     $maxActividades = $totalEtapa3;
 }
 // New Word Document
 $PHPWord = new PHPWord();
 $properties = $PHPWord->getProperties();
 $properties->setCreator('Kelluwen');
 $properties->setCompany('Kelluwen');
 $_estilo_titulo = array('name' => 'Verdana', 'color' => '000000');
 $_estilo_titulo_form_diseno = array('bold' => true);
 $_estilo_titulo_actividad = array('bold' => true);
 // New portrait section
 $section = $PHPWord->createSection();
 $sectionStyle = $section->getSettings();
 // Add header
 $header = $section->createHeader();
 $styleTable = array('borderColor' => '006699', 'borderSize' => 2);
 $styleFirstRow = array('bgColor' => '66BBFF');
 $PHPWord->addTableStyle('myTable', $styleTable, $styleFirstRow);
 $table = $header->addTable();
 $table->addRow();
开发者ID:jordanbarriap,项目名称:app,代码行数:31,代码来源:tdd_crearWord.php

示例3: writeDocPropsCore

 public function writeDocPropsCore(PHPWord $pPHPWord = null)
 {
     // Create XML writer
     $objWriter = null;
     if ($this->getParentWriter()->getUseDiskCaching()) {
         $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
     } else {
         $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY);
     }
     // XML header
     $objWriter->startDocument('1.0', 'UTF-8', 'yes');
     // cp:coreProperties
     $objWriter->startElement('cp:coreProperties');
     $objWriter->writeAttribute('xmlns:cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties');
     $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
     $objWriter->writeAttribute('xmlns:dcterms', 'http://purl.org/dc/terms/');
     $objWriter->writeAttribute('xmlns:dcmitype', 'http://purl.org/dc/dcmitype/');
     $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
     // dc:creator
     $objWriter->writeElement('dc:creator', $pPHPWord->getProperties()->getCreator());
     // cp:lastModifiedBy
     $objWriter->writeElement('cp:lastModifiedBy', $pPHPWord->getProperties()->getLastModifiedBy());
     // dcterms:created
     $objWriter->startElement('dcterms:created');
     $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
     $objWriter->writeRaw(date(DATE_W3C, $pPHPWord->getProperties()->getCreated()));
     $objWriter->endElement();
     // dcterms:modified
     $objWriter->startElement('dcterms:modified');
     $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
     $objWriter->writeRaw(date(DATE_W3C, $pPHPWord->getProperties()->getModified()));
     $objWriter->endElement();
     // dc:title
     $objWriter->writeElement('dc:title', $pPHPWord->getProperties()->getTitle());
     // dc:description
     $objWriter->writeElement('dc:description', $pPHPWord->getProperties()->getDescription());
     // dc:subject
     $objWriter->writeElement('dc:subject', $pPHPWord->getProperties()->getSubject());
     // cp:keywords
     $objWriter->writeElement('cp:keywords', $pPHPWord->getProperties()->getKeywords());
     // cp:category
     $objWriter->writeElement('cp:category', $pPHPWord->getProperties()->getCategory());
     $objWriter->endElement();
     // Return
     return $objWriter->getData();
 }
开发者ID:heruprambadi,项目名称:sim_penyuratan,代码行数:46,代码来源:DocProps.php


注:本文中的PHPWord::getProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。