Drupal 8 получить узел страницы

// Get page node.
$node = \Drupal::routeMatch()->getParameter('node');

// Get page entity.
$params = \Drupal::routeMatch()->getParameters()->all();
$entity = reset($params);
Gleaming Gannet