function theme_region_test_preprocess_region

Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/theme_region_test/theme_region_test.module \theme_region_test_preprocess_region()
  2. 10 core/modules/system/tests/modules/theme_region_test/theme_region_test.module \theme_region_test_preprocess_region()
  3. 11.x core/modules/system/tests/modules/theme_region_test/theme_region_test.module \theme_region_test_preprocess_region()

Implements hook_preprocess_HOOK() for region templates.

File

core/modules/system/tests/modules/theme_region_test/theme_region_test.module, line 11

Code

function theme_region_test_preprocess_region(&$variables) {
    if ($variables['region'] == 'sidebar_first') {
        $variables['attributes']['class'][] = 'new_class';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.