function FormAlter::__construct

Constructs a FormAlter attribute object.

Parameters

string $form_id: (optional) The ID of the form that this implementation alters. If this is left blank then `form_alter` is the hook that is registered.

string $method: (optional) The method name. If this attribute is on a method, this parameter is not required. If this attribute is on a class and this parameter is omitted, the class must have an __invoke() method, which is taken as the hook implementation.

string|null $module: (optional) The module this implementation is for. This allows one module to implement a hook on behalf of another module. Defaults to the module the implementation is in.

\Drupal\Core\Hook\Order\OrderInterface|null $order: (optional) Set the order of the implementation.

Overrides Hook::__construct

File

core/lib/Drupal/Core/Hook/Attribute/FormAlter.php, line 45

Class

FormAlter
Hook attribute for FormAlter.

Namespace

Drupal\Core\Hook\Attribute

Code

public function __construct(string $form_id = '', string $method = '', ?string $module = NULL, ?OrderInterface $order = NULL) {
    parent::__construct($form_id, $method, $module, $order);
}

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