src/Zicht/Bundle/MenuBundle/Url/AliasingStrategy.php
public function generatePublicAlias($subject, $currentAlias = '')
    {
        $path = $this->urlProvider->url($subject);
        $menuItem = $this->menuManager->getItemBy(array(':path' => $path));
        if (!empty($menuItem)) {
            $parts = array();
            for ($item = $menuItem; !is_null($item->getParent()); $item = $item->getParent()) {
                $parts [] = Str::systemize($item->getTitle());
            }
            $alias = '/' . join('/', array_reverse($parts));
        } else {
            $alias = parent::generatePublicAlias($subject);
        }

        return $alias;
    }
public function generatePublicAlias($subject, $currentAlias = '')
    {
        $path = $this->urlProvider->url($subject);
        $menuItem = $this->menuManager->getItemBy(array(':path' => $path));
        if (!empty($menuItem)) {
            $parts = array();
            for ($item = $menuItem; !is_null($item->getParent()); $item = $item->getParent()) {
                $parts [] = Str::systemize($item->getTitle());
            }
            $alias = '/' . join('/', array_reverse($parts));
        } else {
            $alias = parent::generatePublicAlias($subject);
        }

        return $alias;
    }
public function generatePublicAlias ( $ subject , $ currentAlias = '' ) { $ path = $ this -> urlProvider -> url ( $ subject ) ; $ menuItem = $ this -> menuManager -> getItemBy ( array ( ':path' => $ path ) ) ; if ( ! empty ( $ menuItem ) ) { $ parts = array ( ) ; for ( $ item = $ menuItem ; ! is_null ( $ item -> getParent ( ) ) ; $ item = $ item -> getParent ( ) ) { $ parts [ ] = Str :: systemize ( $ item -> getTitle ( ) ) ; } $ alias = '/' . join ( '/' , array_reverse ( $ parts ) ) ; } else { $ alias = parent :: generatePublicAlias ( $ subject ) ; } return $ alias ; }
Generate a public alias for the passed object

@param mixed $subject
@param string $currentAlias
@return string
Generate a public alias for the passed object