You are here

public function ConnectionConfigForm::buildForm in Apigee Edge 8

Form constructor.

Parameters

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

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/ConnectionConfigForm.php, line 49

Class

ConnectionConfigForm
Provides a form for changing connection related settings.

Namespace

Drupal\apigee_edge\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['connect_timeout'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Connection timeout'),
    '#description' => $this
      ->t('Number of seconds before an HTTP connection to Apigee Edge is assumed to have timed out.'),
    '#default_value' => $this
      ->config('apigee_edge.client')
      ->get('http_client_connect_timeout'),
    '#min' => 0,
    '#step' => 0.1,
    '#required' => TRUE,
  ];
  $form['request_timeout'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Request timeout'),
    '#description' => $this
      ->t('Number of seconds before an HTTP response from Apigee Edge is assumed to have timed out.'),
    '#default_value' => $this
      ->config('apigee_edge.client')
      ->get('http_client_timeout'),
    '#min' => 0,
    '#step' => 0.1,
    '#required' => TRUE,
  ];
  $form['http_proxy'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('HTTP client proxy'),
    '#description' => $this
      ->t('Leave empty unless an HTTP proxy is needed to connect to Apigee Edge.'),
    '#default_value' => $this
      ->config('apigee_edge.client')
      ->get('http_client_proxy'),
    '#required' => FALSE,
  ];
  return parent::buildForm($form, $form_state);
}