You are here

class WebformHtmlCommand in Webform 8.5

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

Provides an Ajax command for calling the jQuery html() method.

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

Hierarchy

Expanded class hierarchy of WebformHtmlCommand

1 file declares its use of WebformHtmlCommand
WebformEntityAjaxFormTrait.php in src/Form/WebformEntityAjaxFormTrait.php

File

src/Ajax/WebformHtmlCommand.php, line 12

Namespace

Drupal\webform\Ajax
View source
class WebformHtmlCommand extends HtmlCommand {

  /**
   * Implements Drupal\Core\Ajax\CommandInterface:render().
   */
  public function render() {
    return [
      'command' => 'webformInsert',
      'method' => 'html',
      'selector' => $this->selector,
      'data' => $this
        ->getRenderedContent(),
      'settings' => $this->settings,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommandWithAttachedAssetsTrait::$attachedAssets protected property The attached assets for this Ajax command.
CommandWithAttachedAssetsTrait::getAttachedAssets public function Gets the attached assets.
CommandWithAttachedAssetsTrait::getRenderedContent protected function Processes the content for output.
InsertCommand::$content protected property The content for the matched element(s).
InsertCommand::$selector protected property A CSS selector string.
InsertCommand::$settings protected property A settings array to be passed to any attached JavaScript behavior.
InsertCommand::__construct public function Constructs an InsertCommand object.
WebformHtmlCommand::render public function Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides HtmlCommand::render