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


PHP RecursiveIteratorIterator::callHasChildren方法代码示例

本文整理汇总了PHP中RecursiveIteratorIterator::callHasChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP RecursiveIteratorIterator::callHasChildren方法的具体用法?PHP RecursiveIteratorIterator::callHasChildren怎么用?PHP RecursiveIteratorIterator::callHasChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RecursiveIteratorIterator的用法示例。


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

示例1: callHasChildren

 function callHasChildren()
 {
     $has = parent::callHasChildren();
     $res = $this->getDepth() < $this->max_depth && $has;
     echo __METHOD__ . "(" . $this->getDepth() . ") = " . ($res ? "yes" : "no") . "/" . ($has ? "yes" : "no") . "\n";
     return $res;
 }
开发者ID:gleamingthecube,项目名称:php,代码行数:7,代码来源:ext_spl_tests_iterator_034.php

示例2: callHasChildren

 /**
  * 重写父类中的方法,决定是否有子节点 
  * 
  * @access public
  * @return boolean
  */
 public function callHasChildren()
 {
     $sub_path = $this->getSubPathname();
     if (isset($this->__ignore_dir[$sub_path])) {
         return false;
     }
     return parent::callHasChildren();
 }
开发者ID:nmred,项目名称:dev_swan,代码行数:14,代码来源:sw_iterator_fetch_dir.class.php

示例3: callHasChildren

 /**
  * JTreeRecursiveIterator::callHasChildren()
  * Called for each element to test whether it has children. (See Manual)
  *
  * @return mixed
  */
 public function callHasChildren()
 {
     $ret = parent::callHasChildren();
     $value = $this->current()->getValue();
     if ($ret === true) {
         $this->_str .= "<li>{$value}<ul>\n";
     } else {
         $this->_str .= "<li>{$value}</li>\n";
     }
     return $ret;
 }
开发者ID:jwadhwani,项目名称:tree-php,代码行数:17,代码来源:example-1.php

示例4: callHasChildren

 function callHasChildren()
 {
     $this->skip = false;
     $has = parent::callHasChildren();
     $res = $this->getDepth() < $this->max_depth && $has;
     echo __METHOD__ . "(" . $this->getDepth() . ") = " . ($res ? "yes" : "no") . "/" . ($has ? "yes" : "no") . "\n";
     if ($has && !$res) {
         $this->over++;
         if ($this->over == 2) {
             $this->skip = true;
         }
     }
     return $res;
 }
开发者ID:badlamer,项目名称:hhvm,代码行数:14,代码来源:iterator_021.php

示例5: callHasChildren

 public function callHasChildren()
 {
     $filename = $this->getFilename();
     if ($filename[0] == '.') {
         return false;
     }
     $source = $this->key();
     $target = str_replace($this->source, '', $source);
     $target = str_replace('/site', '', $target);
     $target = Util::buildTargetPath($target, $this->target);
     if (is_link($target)) {
         unlink($target);
     }
     if (!is_dir($target)) {
         $this->createLink($source, $target);
         return false;
     }
     return parent::callHasChildren();
 }
开发者ID:shekkbuilder,项目名称:joomla-console,代码行数:19,代码来源:Iterator.php

示例6: callHasChildren

 public function callHasChildren()
 {
     echo "MyIter::callHasChildren\n";
     return parent::callHasChildren();
 }
开发者ID:jinguanio,项目名称:david,代码行数:5,代码来源:iterator_run.php

示例7: callHasChildren

 function callHasChildren()
 {
     echo __METHOD__ . "; ";
     return parent::callHasChildren();
 }
开发者ID:dw4dev,项目名称:Phalanger,代码行数:5,代码来源:RecursiveIteratorIterator2.php

示例8: RecursiveIteratorIterator

$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($result), RecursiveIteratorIterator::SELF_FIRST);
foreach ($it as $key => $value) {
    $key = str_repeat('&nbsp;&nbsp;&nbsp;', $it->getDepth()) . $key;
    $content .= '<tr>';
    if ($it->callHasChildren()) {
        $content .= '<td colspan="2"><b>' . $key . '</b></td>';
    } else {
        $content .= '<td>' . $key . '</td>';
        $content .= '<td>' . $value . '</td>';
    }
    $content .= '</tr>';
}
$content .= '</table>';
echo $content;
echo '<br />';
// hits
$content = '<table class="elgg-table">';
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($hits), RecursiveIteratorIterator::SELF_FIRST);
foreach ($it as $key => $value) {
    $key = str_repeat('&nbsp;&nbsp;&nbsp;', $it->getDepth()) . $key;
    $content .= '<tr>';
    if ($it->callHasChildren()) {
        $content .= '<td colspan="2"><b>' . $key . '</b></td>';
    } else {
        $content .= '<td>' . $key . '</td>';
        $content .= '<td>' . $value . '</td>';
    }
    $content .= '</tr>';
}
$content .= '</table>';
echo $content;
开发者ID:coldtrick,项目名称:elasticsearch,代码行数:31,代码来源:result.php


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