You are here

public static function SystemTestController::preRenderCacheTags in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::preRenderCacheTags()

Sets a cache tag on an element to help test #pre_render and cache tags.

File

core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php, line 254

Class

SystemTestController
Controller routines for system_test routes.

Namespace

Drupal\system_test\Controller

Code

public static function preRenderCacheTags($elements) {
  $elements['#cache']['tags'][] = 'pre_render';
  return $elements;
}