Created
June 26, 2017 11:56
-
-
Save przor3n/d1176bc32525fbf4b37cee34cc747ebb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$node = \Drupal::routeMatch()->getParameter('node'); | |
if ($node) { | |
// You can get nid and anything else you need from the node object. | |
$nid = $node->id(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment