You are here

class SetFormCommand in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views_ui/src/Ajax/SetFormCommand.php \Drupal\views_ui\Ajax\SetFormCommand
  2. 9 core/modules/views_ui/src/Ajax/SetFormCommand.php \Drupal\views_ui\Ajax\SetFormCommand

Provides an AJAX command for setting a form submit URL in modal forms.

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

Hierarchy

Expanded class hierarchy of SetFormCommand

1 file declares its use of SetFormCommand
ViewsFormBase.php in core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php

File

core/modules/views_ui/src/Ajax/SetFormCommand.php, line 12

Namespace

Drupal\views_ui\Ajax
View source
class SetFormCommand implements CommandInterface {

  /**
   * The URL of the form.
   *
   * @var string
   */
  protected $url;

  /**
   * Constructs a SetFormCommand object.
   *
   * @param string $url
   *   The URL of the form.
   */
  public function __construct($url) {
    $this->url = $url;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    return [
      'command' => 'viewsSetForm',
      'url' => $this->url,
    ];
  }

}

Members