You are here

public function LocalActionManager::getTitle in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Menu/LocalActionManager.php \Drupal\Core\Menu\LocalActionManager::getTitle()

Gets the title for a local action.

Parameters

\Drupal\Core\Menu\LocalActionInterface $local_action: An object to get the title from.

Return value

string The title (already localized).

Throws

\BadMethodCallException If the plugin does not implement the getTitle() method.

Overrides LocalActionManagerInterface::getTitle

1 call to LocalActionManager::getTitle()
LocalActionManager::getActionsForRoute in core/lib/Drupal/Core/Menu/LocalActionManager.php
Finds all local actions that appear on a named route.

File

core/lib/Drupal/Core/Menu/LocalActionManager.php, line 151

Class

LocalActionManager
Provides the default local action manager using YML as primary definition.

Namespace

Drupal\Core\Menu

Code

public function getTitle(LocalActionInterface $local_action) {
  $controller = [
    $local_action,
    'getTitle',
  ];
  $arguments = $this->argumentResolver
    ->getArguments($this->requestStack
    ->getCurrentRequest(), $controller);
  return call_user_func_array($controller, $arguments);
}