class SetFormCommand

Same name in other branches
  1. 9 core/modules/views_ui/src/Ajax/SetFormCommand.php \Drupal\views_ui\Ajax\SetFormCommand
  2. 8.9.x core/modules/views_ui/src/Ajax/SetFormCommand.php \Drupal\views_ui\Ajax\SetFormCommand
  3. 10 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

Title Sort descending Modifiers Object type Summary Overriden Title
SetFormCommand::$url protected property The URL of the form.
SetFormCommand::render public function Overrides CommandInterface::render
SetFormCommand::__construct public function Constructs a SetFormCommand object.

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