public function AccountSettingsForm::buildForm in Optimizely 8.0
Same name and namespace in other branches
- 8 src/AccountSettingsForm.php \Drupal\optimizely\AccountSettingsForm::buildForm()
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 FormInterface::buildForm
File
- src/
AccountSettingsForm.php, line 27 - Contains \Drupal\optimizely\AccountInfoForm
Class
- AccountSettingsForm
- Implements the form for Account Info.
Namespace
Drupal\optimizelyCode
public function buildForm(array $form, FormStateInterface $form_state) {
$settings_form['#theme'] = 'optimizely_account_settings_form';
$form['#attached']['library'][] = 'optimizely/optimizely.forms';
$settings_form['optimizely_id'] = array(
'#type' => 'textfield',
'#title' => $this
->t('Optimizely ID Number'),
'#default_value' => AccountId::getId(),
'#description' => $this
->t('Your Optimizely account ID. This is the number after "/js/" in the' . ' Optimizely Tracking Code found in your account on the Optimizely website.'),
'#size' => 60,
'#maxlength' => 256,
'#required' => TRUE,
);
$settings_form['actions'] = array(
'#type' => 'actions',
);
$settings_form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
return $settings_form;
// Will be $form in the render array and the template file.
}