public function PanopolyDemoInstallerForm::buildForm in Panopoly 8.2
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/
Installer/ Form/ PanopolyDemoInstallerForm.php, line 51
Class
- PanopolyDemoInstallerForm
- Installer form to optionally enable Panopoly Demo.
Namespace
Drupal\panopoly\Installer\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['#title'] = t('Demo content');
$form['enable'] = [
'#type' => 'checkbox',
'#title' => 'Enable demo content',
'#description' => t("Creates some demo content to help you test out Panopoly quickly. If you want to remove it later, simply disable the <em>Panopoly Demo</em> module."),
'#default_value' => TRUE,
];
$form['warning'] = [
'#markup' => "<p><strong>Warning:</strong> Don't install the demo content if you're upgrading from Drupal 7 - you need to start from a blank site.</p>",
];
$form['actions'] = [
'#type' => 'actions',
];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Save and continue'),
'#weight' => 15,
'#button_type' => 'primary',
];
return $form;
}