📜  drupal 8 获取页面标题 - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:33.558000             🧑  作者: Mango

代码示例1
$request     = \Drupal::request();
$route_match = \Drupal::routeMatch();
$title       = \Drupal::service('title_resolver')->getTitle($request, $route_match->getRouteObject());