当前位置: 首页>>代码示例>>PHP>>正文


PHP _MiniXMLError函数代码示例

本文整理汇总了PHP中_MiniXMLError函数的典型用法代码示例。如果您正苦于以下问题:PHP _MiniXMLError函数的具体用法?PHP _MiniXMLError怎么用?PHP _MiniXMLError使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_MiniXMLError函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: numeric

 function numeric($setToPrim = NULL, $setToAlt = NULL)
 {
     $setTo = is_null($setToPrim) ? $setToAlt : $setToPrim;
     if (!is_null($setTo)) {
         if (!is_null($this->xtext)) {
             return _MiniXMLError("MiniXMLElement::numeric() Can't set numeric for element with text.");
         } elseif (!is_numeric($setTo)) {
             return _MiniXMLError("MiniXMLElement::numeric() Must pass a NUMERIC value to set numeric for element.");
         }
         if (MINIXML_DEBUG > 0) {
             _MiniXMLLog("Setting numeric value of node to '{$setTo}'");
         }
         $this->xnumeric = $setTo;
     }
     return $this->xnumeric;
 }
开发者ID:jabouzi,项目名称:belron,代码行数:16,代码来源:node.inc.php

示例2: _MiniXMLError

 function &parent(&$setParent)
 {
     if (!is_null($setParent)) {
         /* Parents can only be MiniXMLElement objects */
         if (!method_exists($setParent, 'MiniXMLTreeComponent')) {
             return _MiniXMLError("MiniXMLTreeComponent::parent(): Must pass an instance derived from " . "MiniXMLTreeComponent to set.");
         }
         $this->xparent = $setParent;
     }
     return $this->xparent;
 }
开发者ID:Peter2121,项目名称:leonardoxc,代码行数:11,代码来源:treecomp.inc.php

示例3: fromArray

 function fromArray(&$init, $params = NULL)
 {
     $this->init();
     if (!is_array($init)) {
         return _MiniXMLError("MiniXMLDoc::fromArray(): Must Pass an ARRAY to initialize from");
     }
     if (!is_array($params)) {
         $params = array();
     }
     if ($params["attributes"] && is_array($params["attributes"])) {
         $attribs = array();
         foreach ($params["attributes"] as $attribName => $value) {
             if (!(array_key_exists($attribName, $attribs) && is_array($attribs[$attribName]))) {
                 $attribs[$attribName] = array();
             }
             if (is_array($value)) {
                 foreach ($value as $v) {
                     if (array_key_exists($v, $attribs[$attribName])) {
                         $attribs[$attribName][$v]++;
                     } else {
                         $attribs[$attribName][$v] = 1;
                     }
                 }
             } else {
                 if (array_key_exists($value, $attribs[$attribName])) {
                     $attribs[$attribName][$value]++;
                 } else {
                     $attribs[$attribName][$value] = 1;
                 }
             }
         }
         // completely replace old attributes by our optimized array
         $params["attributes"] = $attribs;
     } else {
         $params["attributes"] = array();
     }
     foreach ($init as $keyname => $value) {
         $sub = $this->_fromArray_getExtractSub($value);
         $this->{$sub}($keyname, $value, $this->xxmlDoc, $params);
     }
     return $this->xxmlDoc->numChildren();
 }
开发者ID:Sajaki,项目名称:wowroster_dev,代码行数:42,代码来源:doc.inc.php

示例4: _MiniXMLError

 function &appendNode(&$node)
 {
     if (is_null($node)) {
         return _MiniXMLError("MiniXMLElement::appendNode() need to pass a non-NULL MiniXMLNode.");
     }
     if (!method_exists($node, 'MiniXMLNode')) {
         return _MiniXMLError("MiniXMLElement::appendNode() must pass a MiniXMLNode object to appendNode.");
     }
     if (MINIXML_AUTOSETPARENT) {
         if ($this->xparent == $node) {
             return _MiniXMLError("MiniXMLElement::appendnode() Tryng to append parent {$cname} as node of " . $this->xname);
         }
         $node->parent($this);
     }
     $idx = $this->xnumChildren++;
     $this->xchildren[$idx] = $node;
     return $this->xchildren[$idx];
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:18,代码来源:element.inc.php


注:本文中的_MiniXMLError函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。