Answers for "drupal 8 get page node"

1

drupal 8 get page node

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

// Get page entity.
$params = \Drupal::routeMatch()->getParameters()->all();
$entity = reset($params);
Posted by: Guest on September-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language