You are here

public function TestLocalAction4::getTitle in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalAction/TestLocalAction4.php \Drupal\menu_test\Plugin\Menu\LocalAction\TestLocalAction4::getTitle()

Returns the localized title to be shown for this action.

Subclasses may add optional arguments like NodeInterface $node = NULL that will be supplied by the ControllerResolver.

Return value

string The title to be shown for this action.

Overrides LocalActionDefault::getTitle

See also

\Drupal\Core\Menu\LocalActionManager::getTitle()

File

core/modules/system/tests/modules/menu_test/src/Plugin/Menu/LocalAction/TestLocalAction4.php, line 19

Class

TestLocalAction4
Defines a local action plugin with a dynamic title.

Namespace

Drupal\menu_test\Plugin\Menu\LocalAction

Code

public function getTitle(Request $request = NULL) {
  return $this
    ->t('My @arg action', [
    '@arg' => 'dynamic-title',
  ]);
}