class ServerEndpointController
Same name in this branch
- 11.x core/modules/system/tests/modules/sdc_test/src/Controller/ServerEndpointController.php \Drupal\sdc_test\Controller\ServerEndpointController
Same name in other branches
- 10 core/modules/sdc/tests/modules/sdc_test/src/Controller/ServerEndpointController.php \Drupal\sdc_test\Controller\ServerEndpointController
- 10 core/modules/system/tests/modules/sdc_test/src/Controller/ServerEndpointController.php \Drupal\sdc_test\Controller\ServerEndpointController
An endpoint to serve a component during tests.
@internal
Hierarchy
- class \Drupal\sdc_test\Controller\ServerEndpointController
Expanded class hierarchy of ServerEndpointController
File
-
core/
modules/ sdc/ tests/ modules/ sdc_test/ src/ Controller/ ServerEndpointController.php, line 10
Namespace
Drupal\sdc_test\ControllerView source
final class ServerEndpointController {
/**
* Render an arbitrary render array.
*/
public function renderArray() : array {
$render_array = \Drupal::state()->get('sdc_test_component', [
'#markup' => 'Set your component in state using the sdc_test_component key.',
]);
return [
'#type' => 'container',
'#cache' => [
'max-age' => 0,
],
// Magic wrapper ID to pull the HTML from.
'#attributes' => [
'id' => 'sdc-wrapper',
],
'component' => $render_array,
];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ServerEndpointController::renderArray | public | function | Render an arbitrary render array. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.