Snippet if (\Drupal::service('router.admin_context')->isAdminRoute()) { // ... } The router.admin_context service maps to the AdminContext helper class. isAdminRoute() simply checks the Route for the _admin_route option. Pitfalls When working with...
Markdown supported · ⌘↵ to post
No responses yet.