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


PHP SimpleXmlElement::saveXml方法代碼示例

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


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

示例1: _asXml

/**
 * Output as XML
 *
 * @param array $shellList
 * @return void
 */
	protected function _asXml($shellList) {
		$plugins = CakePlugin::loaded();
		$shells = new SimpleXmlElement('<shells></shells>');
		foreach ($shellList as $name => $location) {
			$source = current($location);
			$callable = $name;
			if (in_array($source, $plugins)) {
				$callable = Inflector::camelize($source) . '.' . $name;
			}
			$shell = $shells->addChild('shell');
			$shell->addAttribute('name', $name);
			$shell->addAttribute('call_as', $callable);
			$shell->addAttribute('provider', $source);
			$shell->addAttribute('help', $callable . ' -h');
		}
		$this->stdout->outputAs(ConsoleOutput::RAW);
		$this->out($shells->saveXml());
	}
開發者ID:sherix88,項目名稱:sigedu,代碼行數:24,代碼來源:CommandListShell.php

示例2: _asXml

 /**
  * Output as XML
  *
  * @param array $shellList The shell list.
  * @return void
  */
 protected function _asXml($shellList)
 {
     $plugins = CakePlugin::loaded();
     $shells = new SimpleXmlElement('<shells></shells>');
     foreach ($shellList as $plugin => $commands) {
         foreach ($commands as $command) {
             $callable = $command;
             if (in_array($plugin, $plugins)) {
                 $callable = Inflector::camelize($plugin) . '.' . $command;
             }
             $shell = $shells->addChild('shell');
             $shell->addAttribute('name', $command);
             $shell->addAttribute('call_as', $callable);
             $shell->addAttribute('provider', $plugin);
             $shell->addAttribute('help', $callable . ' -h');
         }
     }
     $this->stdout->outputAs(ConsoleOutput::RAW);
     $this->out($shells->saveXml());
 }
開發者ID:agashish,項目名稱:test_new,代碼行數:26,代碼來源:CommandListShell.php

示例3: _asXml

 /**
  * Output as XML
  *
  * @return void
  */
 protected function _asXml($shellList)
 {
     $plugins = App::objects('plugin');
     $shells = new SimpleXmlElement('<shells></shells>');
     foreach ($shellList as $name => $location) {
         $source = current($location);
         $callable = $name;
         if (in_array($source, $plugins)) {
             $callable = Inflector::underscore($source) . '.' . $name;
         }
         $shell = $shells->addChild('shell');
         $shell->addAttribute('name', $name);
         $shell->addAttribute('call_as', $callable);
         $shell->addAttribute('provider', $source);
         $shell->addAttribute('help', $callable . ' -h');
     }
     $this->out($shells->saveXml());
 }
開發者ID:robotarmy,項目名稱:Phog,代碼行數:23,代碼來源:command_list.php


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