You are here

public function NetlifyFrontendEnvironment::frontEndEnvironmentForm in Build Hooks 3.x

Same name and namespace in other branches
  1. 8.2 modules/build_hooks_netlify/src/Plugin/FrontendEnvironment/NetlifyFrontendEnvironment.php \Drupal\build_hooks_netlify\Plugin\FrontendEnvironment\NetlifyFrontendEnvironment::frontEndEnvironmentForm()

Overrides FrontendEnvironmentBase::frontEndEnvironmentForm

File

modules/build_hooks_netlify/src/Plugin/FrontendEnvironment/NetlifyFrontendEnvironment.php, line 71

Class

NetlifyFrontendEnvironment
Provides a 'Netlify' frontend environment type.

Namespace

Drupal\build_hooks_netlify\Plugin\FrontendEnvironment

Code

public function frontEndEnvironmentForm($form, FormStateInterface $form_state) {
  $form['build_hook_url'] = [
    '#type' => 'url',
    '#title' => $this
      ->t('Build hook url'),
    '#maxlength' => 255,
    '#default_value' => isset($this->configuration['build_hook_url']) ? $this->configuration['build_hook_url'] : '',
    '#description' => $this
      ->t("Build hook url for this environment and branch."),
    '#required' => TRUE,
  ];
  $form['api_id'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('API id'),
    '#maxlength' => 255,
    '#default_value' => isset($this->configuration['api_id']) ? $this->configuration['api_id'] : '',
    '#description' => $this
      ->t("Netlify API ID of this environment"),
    '#required' => TRUE,
  ];
  $form['branch'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Git branch'),
    '#maxlength' => 255,
    '#default_value' => isset($this->configuration['branch']) ? $this->configuration['branch'] : '',
    '#description' => $this
      ->t("Git branch that the build hook refers to."),
    '#required' => TRUE,
  ];
  return $form;
}