public function StaticPreviewForm::buildForm in Tome 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 FormInterface::buildForm
File
- modules/
tome_static/ src/ Form/ StaticPreviewForm.php, line 55
Class
- StaticPreviewForm
- Contains a form for initializing a static preview session.
Namespace
Drupal\tome_static\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['description'] = [
'#markup' => '<p>' . $this
->t('Submitting this form will initiate a preview session of your static site. You can exit the preview by clicking the link at the top of preview pages.') . '</p>',
];
$form['warning'] = [
'#markup' => '<p>' . $this
->t('Note that static assets (CSS, JS, images, etc.) will not necessarily be served from the static directory, so please make a final review on a staging static domain if possible.') . '</p>',
];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Preview'),
];
return $form;
}