public function GotoAction::form

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

array $form_state: An associative array containing the current state of the form.

Return value

array The form structure.

Overrides ConfigurableActionInterface::form

File

drupal/core/modules/action/lib/Drupal/action/Plugin/Action/GotoAction.php, line 44
Contains \Drupal\action\Plugin\Action\GotoAction.

Class

GotoAction
Redirects to a different URL.

Namespace

Drupal\action\Plugin\Action

Code

public function form(array $form, array &$form_state) {
  $form['url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#description' => t('The URL to which the user should be redirected. This can be an internal URL like node/1234 or an external URL like @url.', array(
      '@url' => 'http://drupal.org',
    )),
    '#default_value' => $this->configuration['url'],
    '#required' => TRUE,
  );
  return $form;
}