src/Zicht/Bundle/MenuBundle/Url/MenuItemNameUrlProvider.php
public function suggest($pattern)
    {
        $menuItems = $this->repository->createQueryBuilder('m')
            ->andWhere('m.name LIKE :pattern')
            ->getQuery()
            ->execute(array('pattern' => '%' . $pattern . '%'));

        $suggestions = array();
        foreach ($menuItems as $item) {
            $suggestions[]= array(
                'value' => $item->getName(),
                'label' => sprintf('%s (menu item)', $item)
            );
        }

        return $suggestions;
    }
public function suggest($pattern)
    {
        $menuItems = $this->repository->createQueryBuilder('m')
            ->andWhere('m.name LIKE :pattern')
            ->getQuery()
            ->execute(array('pattern' => '%' . $pattern . '%'));

        $suggestions = array();
        foreach ($menuItems as $item) {
            $suggestions[]= array(
                'value' => $item->getName(),
                'label' => sprintf('%s (menu item)', $item)
            );
        }

        return $suggestions;
    }
public function suggest ( $ pattern ) { $ menuItems = $ this -> repository -> createQueryBuilder ( 'm' ) -> andWhere ( 'm.name LIKE :pattern' ) -> getQuery ( ) -> execute ( array ( 'pattern' => '%' . $ pattern . '%' ) ) ; $ suggestions = array ( ) ; foreach ( $ menuItems as $ item ) { $ suggestions [ ] = array ( 'value' => $ item -> getName ( ) , 'label' => sprintf ( '%s (menu item)' , $ item ) ) ; } return $ suggestions ; }
Suggest url's based on the passed pattern. The return value must be an array containing "label" and "value" keys.

@param string $pattern
@return mixed
Suggest url s based on the passed pattern . The return value must be an array containing label and value keys .