You are here

public static function CircleV2::addMoreSubmit in Build Hooks 3.x

Same name and namespace in other branches
  1. 8.2 modules/build_hooks_circleci/src/Plugin/FrontendEnvironment/CircleV2.php \Drupal\build_hooks_circleci\Plugin\FrontendEnvironment\CircleV2::addMoreSubmit()

Submission handler for the "Add another parameter" button.

File

modules/build_hooks_circleci/src/Plugin/FrontendEnvironment/CircleV2.php, line 204

Class

CircleV2
Defines a circle v2 environment.

Namespace

Drupal\build_hooks_circleci\Plugin\FrontendEnvironment

Code

public static function addMoreSubmit(array $form, FormStateInterface $form_state) {
  $parameters = $form_state
    ->getValue([
    'settings',
    'parameters',
  ], []);
  $parameters[] = [
    'name' => '',
    'type' => 'string',
    'value' => '',
  ];
  $form_state
    ->setValue([
    'settings',
    'parameters',
  ], $parameters);
  $form_state
    ->setRebuild();
}