public function ConsentAgreementForm::buildForm in General Data Protection Regulation 3.0.x
Same name and namespace in other branches
- 8.2 modules/gdpr_consent/src/Form/ConsentAgreementForm.php \Drupal\gdpr_consent\Form\ConsentAgreementForm::buildForm()
- 8 modules/gdpr_consent/src/Form/ConsentAgreementForm.php \Drupal\gdpr_consent\Form\ConsentAgreementForm::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 EntityForm::buildForm
File
- modules/
gdpr_consent/ src/ Form/ ConsentAgreementForm.php, line 65
Class
- ConsentAgreementForm
- Form controller for Consent Agreement edit forms.
Namespace
Drupal\gdpr_consent\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
/** @var \Drupal\gdpr_consent\Entity\ConsentAgreement $entity */
$form = parent::buildForm($form, $form_state);
if (!$this->entity
->isNew()) {
$form['new_revision'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Create new revision'),
'#default_value' => TRUE,
'#weight' => 10,
];
}
return $form;
}