You are here

public function ParagraphsItemController::pageTitle in Paragraphs table 8

The _title_callback for the paragraphs_item.view route.

Parameters

\Drupal\paragraphs\Entity\Paragraph $paragraph: The current paragraphs_item.

Return value

string The page title.

1 string reference to 'ParagraphsItemController::pageTitle'
paragraphs_table.routing.yml in ./paragraphs_table.routing.yml
paragraphs_table.routing.yml

File

src/Controller/ParagraphsItemController.php, line 79

Class

ParagraphsItemController
Returns responses for paragraphs item routes.

Namespace

Drupal\paragraphs_table\Controller

Code

public function pageTitle(Paragraph $paragraph = NULL) {
  return \Drupal::service('entity.repository')
    ->getTranslationFromContext($paragraph)
    ->label() . ' #' . $paragraph
    ->id();
}