function ComponentPluginManager::processDefinitionCategory

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Theme/ComponentPluginManager.php \Drupal\Core\Theme\ComponentPluginManager::processDefinitionCategory()

Processes a plugin definition to ensure there is a category.

If the definition lacks a category, it defaults to the providing module.

Parameters

array $definition: The plugin definition.

Overrides CategorizingPluginManagerTrait::processDefinitionCategory

1 call to ComponentPluginManager::processDefinitionCategory()
ComponentPluginManager::processDefinition in core/lib/Drupal/Core/Theme/ComponentPluginManager.php
Performs extra processing on plugin definitions.

File

core/lib/Drupal/Core/Theme/ComponentPluginManager.php, line 255

Class

ComponentPluginManager
Defines a plugin manager to deal with components.

Namespace

Drupal\Core\Theme

Code

protected function processDefinitionCategory(&$definition) : void {
  $definition['category'] = $definition['group'] ?? $this->t('Other');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.