using params from routes in drupal 8 code example Example: drupal8 get params from route if ($node = \Drupal::routeMatch()->getParameter('node')) { }