You are here

public function MappingController::testConnectionPage in GatherContent 8.3

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

Page callback for connection testing page.

Return value

string Content of the page.

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

File

src/Controller/MappingController.php, line 21

Class

MappingController
Class MappingController.

Namespace

Drupal\gathercontent\Controller

Code

public function testConnectionPage() {
  $account = new Account();
  $success = $account
    ->testConnection();
  if ($success === TRUE) {
    $message = $this
      ->t('Connection successful.');
  }
  else {
    $message = $this
      ->t("Connection wasn't successful.");
  }
  return [
    '#type' => 'markup',
    '#markup' => $message,
  ];
}