本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例6: callHasChildren
public function callHasChildren()
{
echo "MyIter::callHasChildren\n";
return parent::callHasChildren();
}
示例7: callHasChildren
function callHasChildren()
{
echo __METHOD__ . "; ";
return parent::callHasChildren();
}
示例8: RecursiveIteratorIterator
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($result), RecursiveIteratorIterator::SELF_FIRST);
foreach ($it as $key => $value) {
$key = str_repeat(' ', $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(' ', $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;