protected static function activeNodes(Request $request, array $nodes = [], $level = 0) {

        $result = false;

        foreach ($nodes as $n) {

            if (false === ($n instanceof AbstractNavigationNode)) {
                continue;
            }

            if (true === self::nodeMatch($n, $request)) {
                $current = true;
            } else {
                $current = self::activeNodes($request, $n->getNodes(), $level + 1);
            }

            if (false === $current) {
                continue;
            }

            $n->setActive(true);

            $result = true;
        }

        return $result;
    }
protected static function activeNodes(Request $request, array $nodes = [], $level = 0) {

        $result = false;

        foreach ($nodes as $n) {

            if (false === ($n instanceof AbstractNavigationNode)) {
                continue;
            }

            if (true === self::nodeMatch($n, $request)) {
                $current = true;
            } else {
                $current = self::activeNodes($request, $n->getNodes(), $level + 1);
            }

            if (false === $current) {
                continue;
            }

            $n->setActive(true);

            $result = true;
        }

        return $result;
    }
protected static function activeNodes ( Request $ request , array $ nodes = [ ] , $ level = 0 ) { $ result = false ; foreach ( $ nodes as $ n ) { if ( false === ( $ n instanceof AbstractNavigationNode ) ) { continue ; } if ( true === self :: nodeMatch ( $ n , $ request ) ) { $ current = true ; } else { $ current = self :: activeNodes ( $ request , $ n -> getNodes ( ) , $ level + 1 ) ; } if ( false === $ current ) { continue ; } $ n -> setActive ( true ) ; $ result = true ; } return $ result ; }
Actives the nodes.

@param Request $request The request.
@param array $nodes The nodes.
@param int $level The node level.
@return bool Returns true in case of success, false othewise.
Actives the nodes .