📜  drupal 8 检查当前页面是否为节点 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:59.950000             🧑  作者: Mango

代码示例1
$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface) {
  // It's a node!
}