Using \Drupal::routeMatch()->getParameter()
, it's possible to fetch objects that come from the parameters of the URL.
I'm wondering if it is possible to add values to the routeMatch. For example, if using the Groups module, nodes may be part of a group, however the group is not part of the path. Is there a way to load the group from the node, and add the group to the parameters that can be retrieved with \Drupal::routeMatch()->getParameter()
?
Or, more broadly, I'd like to set the $group to be part of the "context" of a page request on a node page.