Answers for "get current content type"

0

get current content type

$node = Drupal::routeMatch()->getParameter('node');
$typeName = $node->bundle();
$typeLabel = $node->getTitle();
Posted by: Guest on January-28-2022

Browse Popular Code Answers by Language