function GotoAction::buildConfigurationForm

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Action/Plugin/Action/GotoAction.php \Drupal\Core\Action\Plugin\Action\GotoAction::buildConfigurationForm()
  2. 8.9.x core/lib/Drupal/Core/Action/Plugin/Action/GotoAction.php \Drupal\Core\Action\Plugin\Action\GotoAction::buildConfigurationForm()
  3. 10 core/lib/Drupal/Core/Action/Plugin/Action/GotoAction.php \Drupal\Core\Action\Plugin\Action\GotoAction::buildConfigurationForm()

Overrides PluginFormInterface::buildConfigurationForm

File

core/lib/Drupal/Core/Action/Plugin/Action/GotoAction.php, line 115

Class

GotoAction
Redirects to a different URL.

Namespace

Drupal\Core\Action\Plugin\Action

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form['url'] = [
        '#type' => 'textfield',
        '#title' => $this->t('URL'),
        '#description' => $this->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.', [
            '@url' => 'http://example.com',
        ]),
        '#default_value' => $this->configuration['url'],
        '#required' => TRUE,
    ];
    return $form;
}

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