protected function markingFinished($numChildrenMethod="numChildren") {
        // Mark childless nodes as expanded.
        if($this->markedNodes) {
            foreach($this->markedNodes as $id => $node) {
                if(!$node->isExpanded() && !$node->$numChildrenMethod()) {
                    $node->markExpanded();
                }
            }
        }
    }
protected function markingFinished($numChildrenMethod="numChildren") {
        // Mark childless nodes as expanded.
        if($this->markedNodes) {
            foreach($this->markedNodes as $id => $node) {
                if(!$node->isExpanded() && !$node->$numChildrenMethod()) {
                    $node->markExpanded();
                }
            }
        }
    }
protected function markingFinished ( $ numChildrenMethod = "numChildren" ) { // Mark childless nodes as expanded. if ( $ this -> markedNodes ) { foreach ( $ this -> markedNodes as $ id => $ node ) { if ( ! $ node -> isExpanded ( ) && ! $ node -> $ numChildrenMethod ( ) ) { $ node -> markExpanded ( ) ; } } } }
Ensure marked nodes that have children are also marked expanded.
Call this after marking but before iterating over the tree.
Ensure marked nodes that have children are also marked expanded . Call this after marking but before iterating over the tree .