public function logout($campaign_id = NULL) {
    $response = new AjaxResponse();

    // Logout member - clear Campaign ID from SESSION.
    MemberCampaign::logout($campaign_id);

    $logoutTitle = $this->t('Thank you!');
    $logoutMessage = $this->t('You were successfully logged out!');

    $response->addCommand(new OpenModalDialogCommand($logoutTitle, $logoutMessage, ['width' => 800]));

    // Close dialog and redirect ot Campaign main page.
    $response->addCommand(new InvokeCommand('#drupal-modal', 'closeDialog', ['<campaign-front>']));

    return $response;
  }
public function logout($campaign_id = NULL) {
    $response = new AjaxResponse();

    // Logout member - clear Campaign ID from SESSION.
    MemberCampaign::logout($campaign_id);

    $logoutTitle = $this->t('Thank you!');
    $logoutMessage = $this->t('You were successfully logged out!');

    $response->addCommand(new OpenModalDialogCommand($logoutTitle, $logoutMessage, ['width' => 800]));

    // Close dialog and redirect ot Campaign main page.
    $response->addCommand(new InvokeCommand('#drupal-modal', 'closeDialog', ['<campaign-front>']));

    return $response;
  }
public function logout ( $ campaign_id = NULL ) { $ response = new AjaxResponse ( ) ; // Logout member - clear Campaign ID from SESSION. MemberCampaign :: logout ( $ campaign_id ) ; $ logoutTitle = $ this -> t ( 'Thank you!' ) ; $ logoutMessage = $ this -> t ( 'You were successfully logged out!' ) ; $ response -> addCommand ( new OpenModalDialogCommand ( $ logoutTitle , $ logoutMessage , [ 'width' => 800 ] ) ) ; // Close dialog and redirect ot Campaign main page. $ response -> addCommand ( new InvokeCommand ( '#drupal-modal' , 'closeDialog' , [ '<campaign-front>' ] ) ) ; return $ response ; }
Callback for logout link.

@param string $campaign_id
Campaign node ID.

@return \Drupal\Core\Ajax\AjaxResponse
Callback for logout link .