You are here

public function ToolbarMenuManager::cleanId in Toolbar Menu 8

Same name and namespace in other branches
  1. 8.2 src/ToolbarMenuManager.php \Drupal\toolbar_menu\ToolbarMenuManager::cleanId()

Helper to clean an ID.

Parameters

string $id: The ID to clean.

Return value

string The cleaned ID.

File

src/ToolbarMenuManager.php, line 77

Class

ToolbarMenuManager
Implement a setting form for toolbar_menu module.

Namespace

Drupal\toolbar_menu

Code

public function cleanId($id) {
  return preg_replace('/[^\\p{L}\\p{N}]/u', '-', $id);
}