public function RenderAttachedTestController::teapotHeaderStatus in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/render_attached_test/src/Controller/RenderAttachedTestController.php \Drupal\render_attached_test\Controller\RenderAttachedTestController::teapotHeaderStatus()
- 9 core/modules/system/tests/modules/render_attached_test/src/Controller/RenderAttachedTestController.php \Drupal\render_attached_test\Controller\RenderAttachedTestController::teapotHeaderStatus()
Tests special header and status code rendering.
Return value
array A render array using features of the 'http_header' directive.
1 string reference to 'RenderAttachedTestController::teapotHeaderStatus'
- render_attached_test.routing.yml in core/
modules/ system/ tests/ modules/ render_attached_test/ render_attached_test.routing.yml - core/modules/system/tests/modules/render_attached_test/render_attached_test.routing.yml
File
- core/
modules/ system/ tests/ modules/ render_attached_test/ src/ Controller/ RenderAttachedTestController.php, line 16
Class
- RenderAttachedTestController
- Controller for various permutations of #attached in the render array.
Namespace
Drupal\render_attached_test\ControllerCode
public function teapotHeaderStatus() {
$render = [];
$render['#attached']['http_header'][] = [
'Status',
418,
];
return $render;
}