Programmatically render a facet
If you want to programmatically render a facet block provided by the Facets module, for example to provide a variable in a preprocess function, it would look something like this:
Check, if a user has access to a route
If you want to check, if a user has access to a route, you can use the checkNamedRoute method of the
Quickly create an instance of a class that uses Drupal's Dependency Injection
Sometimes you might want to get an instance of a class that implements ContainerInjectionInterface in unusual places.
Get current view object from route object
Sometimes you want to get the view object from a route object.