original_string: 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));
      }
code: 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));
      }
code_tokens: 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 ) ) ; }
docstring: Generate route from text.
  
  @param string $text
  @param bool $withSlash
  
  @return string
docstring_tokens: Generate route from text .