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


PHP XML::getXMLString方法代碼示例

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


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

示例1: getHTMLTitlesFormatted

 /**
  *	Returns HTML-formatted RSS items
  *	@method		getHTMLTitlesFormatted
  *	@returns	string HTML-formatted RSS items
  */
 function getHTMLTitlesFormatted()
 {
     $itemBranchesXML = new XML("ul");
     reset($this->itemBranches);
     foreach ($this->itemBranches as $newsItem) {
         $itemXML = new XMLBranch("li");
         $itemLinkXML = new XMLBranch("a");
         $itemLinkXML->setTagContent($newsItem->getTagContent("item/title"));
         $itemLinkXML->setTagAttribute("href", $newsItem->getTagContent("item/link"));
         $itemXML->addXMLBranch($itemLinkXML);
         $itemBranchesXML->addXMLBranch($itemXML);
     }
     return $itemBranchesXML->getXMLString();
 }
開發者ID:VUW-SIM-FIS,項目名稱:emiemi,代碼行數:19,代碼來源:RSS.php

示例2: getClassDocFromClass


//.........這裏部分代碼省略.........
                 $bodyXML->addXMLBranch($spanXML);
                 $bodyXML->addXMLBranch($ulXML);
             } else {
                 $spanXML = new XMLBranch("span");
                 $spanXML->setTagAttribute("class", $infoKey);
                 $spanXML->setTagContent(ucfirst($infoKey) . ": " . $infoValue);
                 $bodyXML->addXMLBranch($spanXML);
             }
         }
         $hrXML = new XMLBranch("hr");
         $bodyXML->addXMLBranch($hrXML);
         $h2XML = new XMLBranch("h2");
         $h2XML->setTagAttribute("class", "methodsTitle");
         $h2XML->setTagContent("All Methods");
         $bodyXML->addXMLBranch($h2XML);
         $spanXML = new XMLBranch("span");
         $spanXML->setTagAttribute("class", "methodList");
         foreach ($objClass->methods as $methodName => $method) {
             $aMethodXML = new XMLBranch("a");
             $aMethodXML->setTagAttribute("href", "#" . $methodName);
             $aMethodXML->setTagContent($methodName);
             $brXML = new XMLBranch("br");
             $spanXML->addXMLBranch($aMethodXML);
             $spanXML->addXMLBranch($brXML);
         }
         $bodyXML->addXMLBranch($spanXML);
         foreach ($objClass->methods as $methodName => $method) {
             $hrXML = new XMLBranch("hr");
             $bodyXML->addXMLBranch($hrXML);
             $pMethodXML = new XMLBranch("p");
             $aMethodXML = new XMLBranch("a");
             $aMethodXML->setTagAttribute("name", $methodName);
             $spanXMLName = new XMLBranch("span");
             $spanXMLName->setTagAttribute("class", "methodName");
             $spanXMLName->setTagContent($methodName);
             $spanXMLArgs = new XMLBranch("span");
             $tagContentArgs = " ( ";
             if (is_array($method->params) && count($method->params) > 0) {
                 $paramCount = 0;
                 foreach ($method->params as $key => $value) {
                     if ($paramCount > 0) {
                         $tagContentArgs .= ", ";
                     }
                     $tagContentArgs .= $key;
                     $paramCount++;
                 }
             }
             $tagContentArgs .= " )";
             $spanXMLArgs->setTagContent($tagContentArgs);
             $aMethodXML->addXMLBranch($spanXMLName);
             $aMethodXML->addXMLBranch($spanXMLArgs);
             $pMethodXML->addXMLBranch($aMethodXML);
             $bodyXML->addXMLBranch($pMethodXML);
             unset($method->info["name"]);
             foreach ($method->info as $infoKey => $infoValue) {
                 if (is_array($infoValue)) {
                     $pXML = new XMLBranch("p");
                     $pXML->setTagAttribute("class", $infoKey);
                     $pXML->setTagContent(ucfirst($infoKey) . ":");
                     $ulXML = new XMLBranch("ul");
                     $ulXML->setTagAttribute("class", $infoKey);
                     foreach ($infoValue as $value) {
                         $liXML = new XMLBranch("li");
                         $liXML->setTagContent($value);
                         $ulXML->addXMLBranch($liXML);
                     }
                     $bodyXML->addXMLBranch($pXML);
                     $bodyXML->addXMLBranch($ulXML);
                 } else {
                     $pXML = new XMLBranch("p");
                     $pXML->setTagAttribute("class", $infoKey);
                     $pXML->setTagContent(ucfirst($infoKey) . ": " . $infoValue);
                     $bodyXML->addXMLBranch($pXML);
                 }
             }
             if (is_array($method->params) && count($method->params) > 0) {
                 $pParamXML = new XMLBranch("p");
                 //$pParamXML->setTagAttribute("class", "param");
                 $paramTitleXML = new XMLBranch("span");
                 $paramTitleXML->setTagContent("Arguments:");
                 $pParamXML->addXMLBranch($paramTitleXML);
                 $paramListXML = new XMLBranch("ul");
                 foreach ($method->params as $key => $value) {
                     $paramItemXML = new XMLBranch("li");
                     $paramItemXML->setTagAttribute("class", "param");
                     $paramItemXML->setTagContent($key);
                     $paramListXML->addXMLBranch($paramItemXML);
                 }
                 $pParamXML->addXMLBranch($paramListXML);
                 $bodyXML->addXMLBranch($pParamXML);
             }
         }
         // ---------------------- END  ---------------------- //
         $classDocXML->addXMLBranch($headXML);
         $classDocXML->addXMLBranch($bodyXML);
         return $classDocXML->getXMLString(0);
     } else {
         return false;
     }
 }
開發者ID:VUW-SIM-FIS,項目名稱:emiemi,代碼行數:101,代碼來源:DocHTML.php


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