コード例 #1
0
ファイル: xml.php プロジェクト: raalveco/Escuela
 /**
  * Agrega un nodo a la salida XML
  * 
  * <code>
  * $xml->addNode(array('value' => 1, 'text' => 'Prueba', 'selected' => '0'));
  * $xml->addNode('value: 1', 'text: Prueba', 'selected: 0');
  * </code>
  * 
  * @param array $arr
  */
 public function add_node($arr)
 {
     $this->_xml->startElement('row');
     if (!is_array($arr)) {
         $arr = Util::getParams(func_get_args());
     }
     foreach ($arr as $key => $value) {
         $this->_xml->writeAttribute($key, $value);
     }
     $this->_xml->endElement();
 }