You are here

public function CircleCiFrontendEnvironment::frontEndEnvironmentForm in Build Hooks 8.2

Same name and namespace in other branches
  1. 3.x modules/build_hooks_circleci/src/Plugin/FrontendEnvironment/CircleCiFrontendEnvironment.php \Drupal\build_hooks_circleci\Plugin\FrontendEnvironment\CircleCiFrontendEnvironment::frontEndEnvironmentForm()

Overrides FrontendEnvironmentBase::frontEndEnvironmentForm

File

modules/build_hooks_circleci/src/Plugin/FrontendEnvironment/CircleCiFrontendEnvironment.php, line 70

Class

CircleCiFrontendEnvironment
Provides a 'CircleCI' frontend environment type.

Namespace

Drupal\build_hooks_circleci\Plugin\FrontendEnvironment

Code

public function frontEndEnvironmentForm($form, FormStateInterface $form_state) {
  $form['project'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Project name'),
    '#maxlength' => 255,
    '#default_value' => isset($this->configuration['project']) ? $this->configuration['project'] : '',
    '#description' => $this
      ->t("Circle CI / Github Project name for this environment. Include the organization name."),
    '#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 to deploy to for this environment."),
    '#required' => TRUE,
  ];
  return $form;
}