📌  相关文章
📜  drupal 9 从节点获取 nid - Javascript 代码示例

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

代码示例1
$node = \Drupal::routeMatch()->getParameter('node');
if ($node instanceof \Drupal\node\NodeInterface) {
  // You can get nid and anything else you need from the node object.
  $nid = $node->id();
}