function SystemTestController::mainContentFallback
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::mainContentFallback()
- 10 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::mainContentFallback()
- 9 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::mainContentFallback()
- 8.9.x core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::mainContentFallback()
Tests main content fallback.
Attributes
#[Route(path: '/system-test/main-content-handling', name: 'system_test.main_content_handling', title: new TranslatableMarkup('Test main content handling'), requirements: [
'_access' => 'TRUE',
])]
#[Route(path: '/system-test/main-content-fallback', name: 'system_test.main_content_fallback', title: new TranslatableMarkup('Test main content fallback'), requirements: [
'_access' => 'TRUE',
])]
#[Route(path: '/system-test/permission-dependent-route-access', name: 'system_test.permission_dependent_route_access', requirements: [
'_permission' => 'pet llamas',
])]
#[Route(path: '/system-test/custom-4xx', name: 'system_test.custom_4xx_with_limited_access', title: new TranslatableMarkup('Admin-only 4xx response'), requirements: [
'_role' => 'administrator',
])]
Return value
string The text to display.
File
-
core/
modules/ system/ tests/ modules/ system_test/ src/ Controller/ SystemTestController.php, line 110
Class
- SystemTestController
- Controller routines for system_test routes.
Namespace
Drupal\system_test\ControllerCode
public function mainContentFallback() {
return [
'#markup' => $this->t('Content to test main content fallback'),
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.