public function generateRouteFromText($text, $withSlash = false)
    {
        if ($withSlash) {
            $result = '';
            foreach (explode('/', $text) as $value) {
                if ('' !== $value = trim($value)) {
                    $result .= '/' . Urlizer::urlize($value);
                }
            }

            return $result ?: '/';
        }

        return $this->normalizeRoute(Urlizer::urlize($text));
    }
public function generateRouteFromText($text, $withSlash = false)
    {
        if ($withSlash) {
            $result = '';
            foreach (explode('/', $text) as $value) {
                if ('' !== $value = trim($value)) {
                    $result .= '/' . Urlizer::urlize($value);
                }
            }

            return $result ?: '/';
        }

        return $this->normalizeRoute(Urlizer::urlize($text));
    }
public function generateRouteFromText ( $ text , $ withSlash = false ) { if ( $ withSlash ) { $ result = '' ; foreach ( explode ( '/' , $ text ) as $ value ) { if ( '' !== $ value = trim ( $ value ) ) { $ result .= '/' . Urlizer :: urlize ( $ value ) ; } } return $ result ? : '/' ; } return $ this -> normalizeRoute ( Urlizer :: urlize ( $ text ) ) ; }
Generate route from text.

@param string $text
@param bool $withSlash

@return string
Generate route from text .