public function get($name, array $options = [])
    {
        if (null === $menu = $this->findByName($name)) {
            throw new \InvalidArgumentException(sprintf('The menu "%s" is not defined.', $name));
        }

        return $this->buildItem($menu, array_merge([
            'attributes' => ['id' => $menu['name'] . '-nav'] // Root css id
        ], $options));
    }
public function get($name, array $options = [])
    {
        if (null === $menu = $this->findByName($name)) {
            throw new \InvalidArgumentException(sprintf('The menu "%s" is not defined.', $name));
        }

        return $this->buildItem($menu, array_merge([
            'attributes' => ['id' => $menu['name'] . '-nav'] // Root css id
        ], $options));
    }
public function get ( $ name , array $ options = [ ] ) { if ( null === $ menu = $ this -> findByName ( $ name ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The menu "%s" is not defined.' , $ name ) ) ; } return $ this -> buildItem ( $ menu , array_merge ( [ 'attributes' => [ 'id' => $ menu [ 'name' ] . '-nav' ] // Root css id ] , $ options ) ) ; }
Retrieves a menu by its name.

@param string $name
@param array  $options

@return \Knp\Menu\ItemInterface
@throws \InvalidArgumentException
Retrieves a menu by its name .