public function MappingController::testConnectionPage in GatherContent 8.4
Same name in this branch
- 8.4 src/Controller/MappingController.php \Drupal\gathercontent\Controller\MappingController::testConnectionPage()
- 8.4 gathercontent_ui/src/Controller/MappingController.php \Drupal\gathercontent_ui\Controller\MappingController::testConnectionPage()
Same name and namespace in other branches
- 8.3 src/Controller/MappingController.php \Drupal\gathercontent\Controller\MappingController::testConnectionPage()
Page callback for connection testing page.
Return value
array Content of the page.
File
- src/
Controller/ MappingController.php, line 45
Class
- MappingController
- Class MappingController.
Namespace
Drupal\gathercontent\ControllerCode
public function testConnectionPage() {
$message = $this
->t('Connection successful.');
try {
$this->client
->meGet();
} catch (\Exception $e) {
$message = $this
->t("Connection wasn't successful.");
}
return [
'#type' => 'markup',
'#markup' => $message,
];
}