SetFormCommand.php

Same filename and directory in other branches
  1. 9 core/modules/views_ui/src/Ajax/SetFormCommand.php
  2. 8.9.x core/modules/views_ui/src/Ajax/SetFormCommand.php
  3. 10 core/modules/views_ui/src/Ajax/SetFormCommand.php

Namespace

Drupal\views_ui\Ajax

File

core/modules/views_ui/src/Ajax/SetFormCommand.php

View source
<?php

namespace Drupal\views_ui\Ajax;

use Drupal\Core\Ajax\CommandInterface;

/**
 * Provides an AJAX command for setting a form submit URL in modal forms.
 *
 * This command is implemented in Drupal.AjaxCommands.prototype.viewsSetForm.
 */
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,
        ];
    }

}

Classes

Title Deprecated Summary
SetFormCommand Provides an AJAX command for setting a form submit URL in modal forms.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.