Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

drupal get route current content type

$node = Drupal::routeMatch()->getParameter('node');
$typeName = $node->bundle();
$typeLabel = $node->getTitle();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #drupal #route #current #content #type
ADD COMMENT
Topic
Name
5+3 =