original_string: protected function url_to_class_name($url) {
          $bits = parse_url($url);
          $class = str_replace('.', '-', $bits['host']);
          if (!empty($bits['port'])) {
              $class .= '--' . $bits['port'];
          }
          if (!empty($bits['path'])) {
              $path = trim($bits['path'], '/');
              if ($path) {
                  $class .= '--' . str_replace('/', '-', $path);
              }
          }
          return $class;
      }
code: protected function url_to_class_name($url) {
          $bits = parse_url($url);
          $class = str_replace('.', '-', $bits['host']);
          if (!empty($bits['port'])) {
              $class .= '--' . $bits['port'];
          }
          if (!empty($bits['path'])) {
              $path = trim($bits['path'], '/');
              if ($path) {
                  $class .= '--' . str_replace('/', '-', $path);
              }
          }
          return $class;
      }
code_tokens: protected function url_to_class_name ( $ url ) { $ bits = parse_url ( $ url ) ; $ class = str_replace ( '.' , '-' , $ bits [ 'host' ] ) ; if ( ! empty ( $ bits [ 'port' ] ) ) { $ class .= '--' . $ bits [ 'port' ] ; } if ( ! empty ( $ bits [ 'path' ] ) ) { $ path = trim ( $ bits [ 'path' ] , '/' ) ; if ( $ path ) { $ class .= '--' . str_replace ( '/' , '-' , $ path ) ; } } return $ class ; }
docstring: Converts the provided URL into a CSS class that be used within the page.
  This is primarily used to add the wwwroot to the body tag as a CSS class.
  
  @param string $url
  @return string
docstring_tokens: Converts the provided URL into a CSS class that be used within the page . This is primarily used to add the wwwroot to the body tag as a CSS class .