src/Zicht/Bundle/MenuBundle/Twig/Extension.php
public function activeTrail($item)
    {
        if (is_null($item)) {
            return null;
        }

        if (!$item instanceof MenuItem) {
            throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item)));
        }

        $stack = array();

        do {
            $stack[]= $item;
        } while ($item = $item->getParent());

        return array_reverse($stack);
    }
public function activeTrail($item)
    {
        if (is_null($item)) {
            return null;
        }

        if (!$item instanceof MenuItem) {
            throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item)));
        }

        $stack = array();

        do {
            $stack[]= $item;
        } while ($item = $item->getParent());

        return array_reverse($stack);
    }
public function activeTrail ( $ item ) { if ( is_null ( $ item ) ) { return null ; } if ( ! $ item instanceof MenuItem ) { throw new \ UnexpectedValueException ( sprintf ( '$ITEM must be \Knp\Menu\MenuItem not "%s"' , get_class ( $ item ) ) ) ; } $ stack = array ( ) ; do { $ stack [ ] = $ item ; } while ( $ item = $ item -> getParent ( ) ) ; return array_reverse ( $ stack ) ; }
Returns the active trail for the given menuItem

@param MenuItem|null $item
@return array
Returns the active trail for the given menuItem