You are here

class WebformConfirmReloadCommand in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Ajax/WebformConfirmReloadCommand.php \Drupal\webform\Ajax\WebformConfirmReloadCommand

Provides an Ajax command for confirming page reload.

This command is implemented in Drupal.AjaxCommands.prototype.webformConfirmReload.

Hierarchy

Expanded class hierarchy of WebformConfirmReloadCommand

1 file declares its use of WebformConfirmReloadCommand
WebformAjaxFormTrait.php in src/Form/WebformAjaxFormTrait.php

File

src/Ajax/WebformConfirmReloadCommand.php, line 12

Namespace

Drupal\webform\Ajax
View source
class WebformConfirmReloadCommand implements CommandInterface {

  /**
   * The message to be displayed.
   *
   * @var string
   */
  protected $message;

  /**
   * Constructs an WebformConfirmReloadCommand object.
   *
   * @param string $message
   *   The message to be displayed.
   */
  public function __construct($message) {
    $this->message = $message;
  }

  /**
   * Implements \Drupal\Core\Ajax\CommandInterface:render().
   */
  public function render() {
    return [
      'command' => 'webformConfirmReload',
      'message' => $this->message,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WebformConfirmReloadCommand::$message protected property The message to be displayed.
WebformConfirmReloadCommand::render public function Implements \Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface::render
WebformConfirmReloadCommand::__construct public function Constructs an WebformConfirmReloadCommand object.