public function SystemTestController::system_test_cache_maxage_page in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::system_test_cache_maxage_page()
Set cache max-age on the returned render array.
1 string reference to 'SystemTestController::system_test_cache_maxage_page'
- system_test.routing.yml in core/
modules/ system/ tests/ modules/ system_test/ system_test.routing.yml - core/modules/system/tests/modules/system_test/system_test.routing.yml
File
- core/
modules/ system/ tests/ modules/ system_test/ src/ Controller/ SystemTestController.php, line 241
Class
- SystemTestController
- Controller routines for system_test routes.
Namespace
Drupal\system_test\ControllerCode
public function system_test_cache_maxage_page() {
$build['main'] = [
'#cache' => [
'max-age' => 90,
],
'message' => [
'#markup' => 'Cache max-age page example',
],
];
return $build;
}