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


PHP XmlWriter::writeCdata方法代碼示例

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


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

示例1: writeElement

 public function writeElement($name, $value, $prefix = null, $url = null)
 {
     if ($prefix !== null) {
         $this->cursor->writeElementNs($prefix, $name, $url, $value);
     } elseif ($this->needsCdataWrapping($value)) {
         $this->startElement($name, $prefix, $url);
         $this->cursor->writeCdata($value);
         $this->endElement();
     } else {
         $this->cursor->writeElement($name, $value);
     }
 }
開發者ID:richardfullmer,項目名稱:oxm,代碼行數:12,代碼來源:WriterHelper.php

示例2: writeValue

 public function writeValue($value)
 {
     if ($this->needsCdataWrapping($value)) {
         $this->cursor->writeCdata($value);
     } else {
         $this->cursor->text($value);
     }
 }
開發者ID:doctrine,項目名稱:oxm,代碼行數:8,代碼來源:WriterHelper.php

示例3: toXml

 function toXml(XmlWriter $x, $writeEnvelope = true)
 {
     if ($writeEnvelope) {
         $x->startElement('http-request');
     }
     $x->startElement('method');
     $x->text($this->getMethod());
     $x->endElement();
     $x->startElement('url');
     $x->text($this->getUrl());
     $x->endElement();
     $x->startElement('headers');
     foreach ($this->getHeaders() as $k => $v) {
         $x->startElement('header');
         $x->writeAttribute('name', $k);
         $x->text($v);
         $x->endElement();
     }
     $x->endElement();
     $x->startElement('params');
     foreach ($this->getPostParams() as $k => $v) {
         $x->startElement('param');
         $x->writeAttribute('name', $k);
         $x->text($v);
         $x->endElement();
     }
     $x->endElement();
     if (!$this->getPostParams() && $this->getBody()) {
         $x->startElement('body');
         $x->writeCdata($this->getBody());
         $x->endElement();
     }
     if ($writeEnvelope) {
         $x->endElement();
     }
 }
開發者ID:irovast,項目名稱:eyedock,代碼行數:36,代碼來源:HttpRequest.php

示例4: writeCategory

 private function writeCategory(\XmlWriter $writer, Category $category)
 {
     $writer->startElement('category');
     if ($category->getDomain()) {
         $writer->writeAttribute('domain', $category->getDomain());
     }
     $writer->writeCdata($category->getTitle());
     $writer->endElement();
 }
開發者ID:marcw,項目名稱:rss-writer,代碼行數:9,代碼來源:CoreWriter.php

示例5: toXml

 function toXml(XmlWriter $x)
 {
     $x->startElement('url');
     $x->startElement('method');
     $x->text($this->getMethod());
     $x->endElement();
     $x->startElement('scheme');
     $x->text($this->getScheme());
     $x->endElement();
     $x->startElement('base_url');
     $x->text($this->getBaseUrl(true));
     $x->endElement();
     $x->startElement('path_info');
     $x->text($this->getPathInfo());
     $x->endElement();
     $x->startElement('host');
     $x->text($this->getHttpHost());
     $x->endElement();
     $x->startElement('remote_addr');
     $x->text($this->getClientIp(false));
     $x->endElement();
     $x->endElement();
     $x->startElement('params');
     foreach ($this->getRequestOnlyParams() as $k => $v) {
         $x->startElement('param');
         $x->writeAttribute('name', $k);
         if (is_array($v) || is_object($v)) {
             $v = json_encode($v);
             $x->writeAttribute("serialized", "json");
             $x->writeCdata($v);
         } else {
             $x->text($v);
         }
         $x->endElement();
     }
     $x->endElement();
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:37,代碼來源:Request.php


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