function AjaxTestController::renderTypes

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php \Drupal\ajax_test\Controller\AjaxTestController::renderTypes()
  2. 8.9.x core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php \Drupal\ajax_test\Controller\AjaxTestController::renderTypes()
  3. 10 core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php \Drupal\ajax_test\Controller\AjaxTestController::renderTypes()

Example content for testing the wrapper of the response.

Parameters

string $type: Type of response.

Return value

array Renderable array of AJAX response contents.

1 string reference to 'AjaxTestController::renderTypes'
ajax_test.routing.yml in core/modules/system/tests/modules/ajax_test/ajax_test.routing.yml
core/modules/system/tests/modules/ajax_test/ajax_test.routing.yml

File

core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php, line 57

Class

AjaxTestController
Provides content for dialog tests.

Namespace

Drupal\ajax_test\Controller

Code

public function renderTypes($type) {
  return [
    '#title' => '<em>AJAX Dialog & contents</em>',
    'content' => [
      '#type' => 'inline_template',
      '#template' => $this->getRenderTypes()[$type]['render'],
    ],
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.