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


PHP Xml::elementClean方法代碼示例

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


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

示例1: objectRow

 /**
  * Constructs HTML representation of a single key-value pair.
  * @return string: HTML.
  */
 static function objectRow($key, $val)
 {
     $th = Xml::elementClean('th', array(), $key);
     if (is_array($val)) {
         $td = Xml::tags('td', array(), self::objectTable($val));
     } else {
         if (is_string($val)) {
             $val = '"' . $val . '"';
         } else {
             $val = FormatJson::encode($val);
         }
         $td = Xml::elementClean('td', array('class' => 'value'), $val);
     }
     return Xml::tags('tr', array(), $th . $td);
 }
開發者ID:biribogos,項目名稱:wikihow-src,代碼行數:19,代碼來源:JsonSchemaContent.php

示例2: writeUpload

 /**
  * @param File $file
  * @param bool $dumpContents
  * @return string
  */
 function writeUpload($file, $dumpContents = false)
 {
     if ($file->isOld()) {
         $archiveName = "      " . Xml::element('archivename', null, $file->getArchiveName()) . "\n";
     } else {
         $archiveName = '';
     }
     if ($dumpContents) {
         $be = $file->getRepo()->getBackend();
         # Dump file as base64
         # Uses only XML-safe characters, so does not need escaping
         # @todo Too bad this loads the contents into memory (script might swap)
         $contents = '      <contents encoding="base64">' . chunk_split(base64_encode($be->getFileContents(array('src' => $file->getPath())))) . "      </contents>\n";
     } else {
         $contents = '';
     }
     if ($file->isDeleted(File::DELETED_COMMENT)) {
         $comment = Xml::element('comment', array('deleted' => 'deleted'));
     } else {
         $comment = Xml::elementClean('comment', null, $file->getDescription());
     }
     return "    <upload>\n" . $this->writeTimestamp($file->getTimestamp()) . $this->writeContributor($file->getUser('id'), $file->getUser('text')) . "      " . $comment . "\n" . "      " . Xml::element('filename', null, $file->getName()) . "\n" . $archiveName . "      " . Xml::element('src', null, $file->getCanonicalURL()) . "\n" . "      " . Xml::element('size', null, $file->getSize()) . "\n" . "      " . Xml::element('sha1base36', null, $file->getSha1()) . "\n" . "      " . Xml::element('rel', null, $file->getRel()) . "\n" . $contents . "    </upload>\n";
 }
開發者ID:Habatchii,項目名稱:wikibase-for-mediawiki,代碼行數:28,代碼來源:Export.php

示例3: writeUpload

 function writeUpload($file)
 {
     return "    <upload>\n" . $this->writeTimestamp($file->getTimestamp()) . $this->writeContributor($file->getUser('id'), $file->getUser('text')) . "      " . Xml::elementClean('comment', null, $file->getDescription()) . "\n" . "      " . Xml::element('filename', null, $file->getName()) . "\n" . "      " . Xml::element('src', null, $file->getFullUrl()) . "\n" . "      " . Xml::element('size', null, $file->getSize()) . "\n" . "    </upload>\n";
 }
開發者ID:ruizrube,項目名稱:spdef,代碼行數:4,代碼來源:Export.php

示例4: wfElementClean

function wfElementClean($element, $attribs = array(), $contents = '')
{
    return Xml::elementClean($element, $attribs, $contents);
}
開發者ID:BackupTheBerlios,項目名稱:shoutwiki-svn,代碼行數:4,代碼來源:XmlFunctions.php

示例5: wfElementClean

function wfElementClean($element, $attribs = array(), $contents = '')
{
    wfDeprecated(__FUNCTION__);
    return Xml::elementClean($element, $attribs, $contents);
}
開發者ID:amjadtbssm,項目名稱:website,代碼行數:5,代碼來源:XmlFunctions.php

示例6: writeUpload

 /**
  * @param $file File
  * @param $dumpContents bool
  * @return string
  */
 function writeUpload($file, $dumpContents = false)
 {
     if ($file->isOld()) {
         $archiveName = "      " . Xml::element('archivename', null, $file->getArchiveName()) . "\n";
     } else {
         $archiveName = '';
     }
     if ($dumpContents) {
         # Dump file as base64
         # Uses only XML-safe characters, so does not need escaping
         $contents = '      <contents encoding="base64">' . chunk_split(base64_encode(file_get_contents($file->getPath()))) . "      </contents>\n";
     } else {
         $contents = '';
     }
     return "    <upload>\n" . $this->writeTimestamp($file->getTimestamp()) . $this->writeContributor($file->getUser('id'), $file->getUser('text')) . "      " . Xml::elementClean('comment', null, $file->getDescription()) . "\n" . "      " . Xml::element('filename', null, $file->getName()) . "\n" . $archiveName . "      " . Xml::element('src', null, $file->getCanonicalUrl()) . "\n" . "      " . Xml::element('size', null, $file->getSize()) . "\n" . "      " . Xml::element('sha1base36', null, $file->getSha1()) . "\n" . "      " . Xml::element('rel', null, $file->getRel()) . "\n" . $contents . "    </upload>\n";
 }
開發者ID:laiello,項目名稱:media-wiki-law,代碼行數:21,代碼來源:Export.php

示例7: writeRedirects

 function writeRedirects($row)
 {
     $out = '';
     if (isset($this->_redirects[$row->up_page])) {
         foreach ($this->_redirects[$row->up_page] as $row) {
             $title = Title::makeTitle($row->page_namespace, $row->page_title);
             $out .= "    <redirect>\n";
             $out .= '    ' . Xml::elementClean('title', array(), $title->getPrefixedText()) . "\n";
             if (isset($row->num_page_ref)) {
                 $out .= '    ' . Xml::element('references', array(), strval($row->num_page_ref)) . "\n";
             }
             $out .= "    </redirect>\n";
         }
     }
     return $out;
 }
開發者ID:yusufchang,項目名稱:app,代碼行數:16,代碼來源:OAIRepo_body.php


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