当前位置: 首页>>代码示例>>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;未经允许,请勿转载。