public function TestController::modalContentInput in Drupal 9
Return modal content with autofocus input.
Return value
array Render array for display in modal.
1 string reference to 'TestController::modalContentInput'
- dialog_renderer_test.routing.yml in core/
modules/ system/ tests/ modules/ dialog_renderer_test/ dialog_renderer_test.routing.yml - core/modules/system/tests/modules/dialog_renderer_test/dialog_renderer_test.routing.yml
File
- core/
modules/ system/ tests/ modules/ dialog_renderer_test/ src/ Controller/ TestController.php, line 52
Class
- TestController
- Test controller display modal links and content.
Namespace
Drupal\dialog_renderer_test\ControllerCode
public function modalContentInput() {
return [
'#type' => 'container',
'text' => [
'#type' => 'markup',
'#markup' => 'Look at me in a modal!<br><a href="#">And a link!</a>',
],
'input' => [
'#type' => 'textfield',
'#size' => 60,
'#attributes' => [
'autofocus' => TRUE,
],
],
];
}