function TestClass::onKernelResponseTest
Same name in other branches
- 9 core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass::onKernelResponseTest()
- 8.9.x core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass::onKernelResponseTest()
- 11.x core/modules/system/tests/modules/service_provider_test/src/TestClass.php \Drupal\service_provider_test\TestClass::onKernelResponseTest()
Flags the response in case a rebuild indicator is used.
File
-
core/
modules/ system/ tests/ modules/ service_provider_test/ src/ TestClass.php, line 41
Class
Namespace
Drupal\service_provider_testCode
public function onKernelResponseTest(ResponseEvent $event) {
$container = \Drupal::getContainer();
if ($container->hasParameter('container_rebuild_indicator')) {
$event->getResponse()->headers
->set('container_rebuild_indicator', $container->getParameter('container_rebuild_indicator'));
}
if ($container->hasParameter('container_rebuild_test_parameter')) {
$event->getResponse()->headers
->set('container_rebuild_test_parameter', $container->getParameter('container_rebuild_test_parameter'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.