function CommonTestThemeHooks::commonTestRenderElement

Implements hook_preprocess_HOOK().

Attributes

#[Hook('preprocess_common_test_render_element')]

See also

RenderTest::testDrupalRenderThemePreprocessAttached()

File

core/modules/system/tests/modules/common_test/src/Hook/CommonTestThemeHooks.php, line 157

Class

CommonTestThemeHooks
Hook implementations for common_test.

Namespace

Drupal\common_test\Hook

Code

public function commonTestRenderElement(&$variables) : void {
  if (!\Drupal::state()->get('theme_preprocess_attached_test', FALSE)) {
    return;
  }
  $variables['#attached']['library'][] = 'test/specific_preprocess';
}

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