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


PHP Writer::writeAttributes方法代码示例

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


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

示例1: xmlSerialize

 /**
  * The xmlSerialize metod is called during xml writing.
  *
  * Use the $writer argument to write its own xml serialization.
  *
  * An important note: do _not_ create a parent element. Any element
  * implementing XmlSerializble should only ever write what's considered
  * its 'inner xml'.
  *
  * The parent of the current element is responsible for writing a
  * containing element.
  *
  * This allows serializers to be re-used for different element names.
  *
  * If you are opening new elements, you must also close them again.
  *
  * @param Writer $writer
  * @return void
  */
 function xmlSerialize(Writer $writer)
 {
     $writer->startElement('{' . Plugin::NS_CALDAV . '}calendar-data');
     $writer->writeAttributes(['content-type' => 'text/calendar', 'version' => '2.0']);
     $writer->endElement();
     // calendar-data
     $writer->startElement('{' . Plugin::NS_CALDAV . '}calendar-data');
     $writer->writeAttributes(['content-type' => 'application/calendar+json']);
     $writer->endElement();
     // calendar-data
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:30,代码来源:SupportedCalendarData.php

示例2: xmlSerialize

 /**
  * The xmlSerialize metod is called during xml writing.
  *
  * Use the $writer argument to write its own xml serialization.
  *
  * An important note: do _not_ create a parent element. Any element
  * implementing XmlSerializble should only ever write what's considered
  * its 'inner xml'.
  *
  * The parent of the current element is responsible for writing a
  * containing element.
  *
  * This allows serializers to be re-used for different element names.
  *
  * If you are opening new elements, you must also close them again.
  *
  * @param Writer $writer
  * @return void
  */
 function xmlSerialize(Writer $writer)
 {
     foreach ($this->components as $component) {
         $writer->startElement('{' . Plugin::NS_CALDAV . '}comp');
         $writer->writeAttributes(['name' => $component]);
         $writer->endElement();
     }
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:27,代码来源:SupportedCalendarComponentSet.php

示例3: xmlSerialize

 /**
  * The xmlSerialize metod is called during xml writing.
  *
  * Use the $writer argument to write its own xml serialization.
  *
  * An important note: do _not_ create a parent element. Any element
  * implementing XmlSerializble should only ever write what's considered
  * its 'inner xml'.
  *
  * The parent of the current element is responsible for writing a
  * containing element.
  *
  * This allows serializers to be re-used for different element names.
  *
  * If you are opening new elements, you must also close them again.
  *
  * @param Writer $writer
  * @return void
  */
 function xmlSerialize(Writer $writer)
 {
     foreach ($this->supportedData as $supported) {
         $writer->startElement('{' . Plugin::NS_CARDDAV . '}address-data-type');
         $writer->writeAttributes(['content-type' => $supported['contentType'], 'version' => $supported['version']]);
         $writer->endElement();
         // address-data-type
     }
 }
开发者ID:sebbie42,项目名称:casebox,代码行数:28,代码来源:SupportedAddressData.php

示例4: writeDataFields

 private function writeDataFields(array $fields, Writer $writer)
 {
     array_map(function (DataField $field) use($writer) {
         $writer->startElement(static::nameElement('datafield'));
         $writer->writeAttributes(['tag' => $field->getTag(), 'ind1' => $field->getIndicator1(), 'ind2' => $field->getIndicator2()]);
         $this->writeSubFields($field->getSubFields(), $writer);
         $writer->endElement();
     }, $fields);
 }
开发者ID:tonyhhyip,项目名称:marc4php,代码行数:9,代码来源:MarcXMLWriter.php


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