Last active
April 4, 2018 17:40
-
-
Save Niklan/05bed3a0b96bda2d150ec72492d4eb16 to your computer and use it in GitHub Desktop.
Drupal 8 detect if there entity on page
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
$parameters = \Drupal::routeMatch()->getParameters(); | |
foreach ($parameters as $parameter) { | |
if ($parameter instanceof EntityInterface) { | |
// Entity page. | |
} | |
} |
Chi-teck
commented
Apr 4, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment