function StaticMenuLinkOverrides::encodeId
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php \Drupal\Core\Menu\StaticMenuLinkOverrides::encodeId()
- 10 core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php \Drupal\Core\Menu\StaticMenuLinkOverrides::encodeId()
- 11.x core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php \Drupal\Core\Menu\StaticMenuLinkOverrides::encodeId()
Encodes the ID by replacing dots with double underscores.
This is done because config schema uses dots for its internal type hierarchy. Double underscores are converted to triple underscores to avoid accidental conflicts.
Parameters
string $id: The menu plugin ID.
Return value
string The menu plugin ID with double underscore instead of dots.
4 calls to StaticMenuLinkOverrides::encodeId()
- StaticMenuLinkOverrides::deleteMultipleOverrides in core/
lib/ Drupal/ Core/ Menu/ StaticMenuLinkOverrides.php - Deletes multiple overrides to definitions of static (YAML-defined) links.
- StaticMenuLinkOverrides::loadMultipleOverrides in core/
lib/ Drupal/ Core/ Menu/ StaticMenuLinkOverrides.php - Loads overrides to multiple definitions of a static (YAML-defined) link.
- StaticMenuLinkOverrides::loadOverride in core/
lib/ Drupal/ Core/ Menu/ StaticMenuLinkOverrides.php - Loads any overrides to the definition of a static (YAML-defined) link.
- StaticMenuLinkOverrides::saveOverride in core/
lib/ Drupal/ Core/ Menu/ StaticMenuLinkOverrides.php - Saves the override.
File
-
core/
lib/ Drupal/ Core/ Menu/ StaticMenuLinkOverrides.php, line 176
Class
- StaticMenuLinkOverrides
- Defines an implementation of the menu link override using a config file.
Namespace
Drupal\Core\MenuCode
protected static function encodeId($id) {
return strtr($id, [
'.' => '__',
'__' => '___',
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.