You are here

public function UnapprovedComments::getTitle in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php \Drupal\comment\Plugin\Menu\LocalTask\UnapprovedComments::getTitle()

Returns the localized title to be shown for this tab.

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

Return value

string The title of the local task.

Overrides LocalTaskDefault::getTitle

File

core/modules/comment/src/Plugin/Menu/LocalTask/UnapprovedComments.php, line 57

Class

UnapprovedComments
Provides a local task that shows the amount of unapproved comments.

Namespace

Drupal\comment\Plugin\Menu\LocalTask

Code

public function getTitle(Request $request = NULL) {
  return $this
    ->t('Unapproved comments (@count)', [
    '@count' => $this->commentStorage
      ->getUnapprovedCount(),
  ]);
}