示例#1
0
 public function setOption($name, $value)
 {
     $xmlOptions = XmlHelper::getNode($this->xml, "options");
     $lstOptions = $xmlOptions->childNodes;
     // search for option, if found, set & exit
     if ($lstOptions != null) {
         foreach ($lstOptions as $xmlOption) {
             if ($xmlOption->getAttribute("name") == $name) {
                 XmlHelper::setValue($xmlOption, $value);
                 return;
             }
         }
     }
     // create new option
     $xmlNewOption = $this->xml->ownerDocument->createElement("option");
     $xmlNewOption->setAttribute("name", $name);
     XmlHelper::setValue($xmlNewOption, $value);
     $xmlOption->appendChild($xmlNewOption);
     return "";
 }