You are here

public function MappingController::testConnectionPage in GatherContent 8.4

Same name in this branch
  1. 8.4 src/Controller/MappingController.php \Drupal\gathercontent\Controller\MappingController::testConnectionPage()
  2. 8.4 gathercontent_ui/src/Controller/MappingController.php \Drupal\gathercontent_ui\Controller\MappingController::testConnectionPage()
Same name and namespace in other branches
  1. 8.5 gathercontent_ui/src/Controller/MappingController.php \Drupal\gathercontent_ui\Controller\MappingController::testConnectionPage()

Page callback for connection testing page.

Return value

array Content of the page.

1 string reference to 'MappingController::testConnectionPage'
gathercontent_ui.routing.yml in gathercontent_ui/gathercontent_ui.routing.yml
gathercontent_ui/gathercontent_ui.routing.yml

File

gathercontent_ui/src/Controller/MappingController.php, line 45

Class

MappingController
Class MappingController.

Namespace

Drupal\gathercontent_ui\Controller

Code

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,
  ];
}