You are here

public function TocFormatterInterface::convertStringToId in TOC API 8

Convert a string to a valid HTML id.

Notes: At some point, D8 core or contrib (ie Drupal\pathauto\AliasCleaner) will provide a service to slugify strings based on predefined options.

Inspired by:

Parameters

string $text: String to be converted to a valid HTML id.

Return value

string A valid HTML id.

1 method overrides TocFormatterInterface::convertStringToId()
TocFormatter::convertStringToId in src/TocFormatter.php
Convert a string to a valid HTML id.

File

src/TocFormatterInterface.php, line 29

Class

TocFormatterInterface
Provides an interface defining a TOC formatter.

Namespace

Drupal\toc_api

Code

public function convertStringToId($text);