class InvokeCommand implements CommandInterface (View source)

AJAX command for invoking an arbitrary jQuery method.

The 'invoke' command will instruct the client to invoke the given jQuery method with the supplied arguments on the elements matched by the given selector. Intended for simple jQuery commands, such as attr(), addClass(), removeClass(), toggleClass(), etc.

This command is implemented by Drupal.AjaxCommands.prototype.invoke() defined in misc/ajax.js.

Properties

protected string $selector

A CSS selector string.

protected string $method

A jQuery method to invoke.

protected array $arguments

An optional list of arguments to pass to the method.

Methods

__construct(string $selector, string $method, array $arguments = [])

Constructs an InvokeCommand object.

render()

Implements Drupal\Core\Ajax\CommandInterface:render().

Details

__construct(string $selector, string $method, array $arguments = [])

Constructs an InvokeCommand object.

Parameters

string $selector

A jQuery selector.

string $method

The name of a jQuery method to invoke.

array $arguments

An optional array of arguments to pass to the method.

render()

Implements Drupal\Core\Ajax\CommandInterface:render().