function BreakpointManager::getGroupLabel

Same name in other branches
  1. 9 core/modules/breakpoint/src/BreakpointManager.php \Drupal\breakpoint\BreakpointManager::getGroupLabel()
  2. 8.9.x core/modules/breakpoint/src/BreakpointManager.php \Drupal\breakpoint\BreakpointManager::getGroupLabel()
  3. 11.x core/modules/breakpoint/src/BreakpointManager.php \Drupal\breakpoint\BreakpointManager::getGroupLabel()

Gets the label for a breakpoint group.

Parameters

string $group: The breakpoint group.

Return value

string The label.

1 call to BreakpointManager::getGroupLabel()
BreakpointManager::getGroups in core/modules/breakpoint/src/BreakpointManager.php

File

core/modules/breakpoint/src/BreakpointManager.php, line 252

Class

BreakpointManager
Defines a breakpoint plugin manager to deal with breakpoints.

Namespace

Drupal\breakpoint

Code

protected function getGroupLabel($group) {
    // Extension names are not translatable.
    if ($this->moduleHandler
        ->moduleExists($group)) {
        $label = $this->moduleExtensionList
            ->getName($group);
    }
    elseif ($this->themeHandler
        ->themeExists($group)) {
        $label = $this->themeHandler
            ->getName($group);
    }
    else {
        // Custom group label that should be translatable.
        $label = $this->t($group, [], [
            'context' => 'breakpoint',
        ]);
    }
    return $label;
}

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