public function CasUserInteractionTestForm::buildForm in CAS 8
Same name and namespace in other branches
- 2.x tests/modules/cas_user_interaction_test/src/CasUserInteractionTestForm.php \Drupal\cas_user_interaction_test\CasUserInteractionTestForm::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
- tests/
modules/ cas_user_interaction_test/ src/ CasUserInteractionTestForm.php, line 17
Class
- CasUserInteractionTestForm
- Form that enforces the user to accept the new site's 'Legal Notice'.
Namespace
Drupal\cas_user_interaction_testCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['accept'] = [
'#type' => 'checkbox',
'#title' => "I agree with the 'Legal Notice'",
'#required' => TRUE,
];
$form['submit'] = [
'#type' => 'submit',
'#value' => 'I agree',
];
return $form;
}