Forked from markconroy/Create Global Variable Drupal 8
Created
January 16, 2022 21:24
-
-
Save UshaMakoa/50891d5a54269e4d692db624513b64b7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function MYMODULE_template_preprocess_default_variables_alter(&$variables) { | |
$current_path = \Drupal::service('path.current')->getPath(); | |
$variables['current_path'] = $current_path; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment