triển khai drupal để làm FE
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Functions to support theming in the S.I.S Can Tho theme.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_preprocess_HOOK() for page templates.
|
||||
*/
|
||||
function sis_theme_preprocess_page(&$variables) {
|
||||
// Pass dynamic front page URL
|
||||
$variables['front_page'] = \Drupal::urlGenerator()->generateFromRoute('<front>');
|
||||
|
||||
// Try to determine if the current page is the front page
|
||||
try {
|
||||
$variables['is_front'] = \Drupal::service('path.matcher')->isFrontPage();
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
$variables['is_front'] = FALSE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user