public function FillPdfFormExportForm::form in FillPDF 8.4
Same name and namespace in other branches
- 5.0.x src/Form/FillPdfFormExportForm.php \Drupal\fillpdf\Form\FillPdfFormExportForm::form()
Gets the actual form array to be built.
Overrides EntityForm::form
See also
\Drupal\Core\Entity\EntityForm::processForm()
\Drupal\Core\Entity\EntityForm::afterBuild()
File
- src/
Form/ FillPdfFormExportForm.php, line 44
Class
- FillPdfFormExportForm
- Form controller for the FillPdfForm export form.
Namespace
Drupal\fillpdf\FormCode
public function form(array $form, FormStateInterface $form_state) {
parent::form($form, $form_state);
/** @var \Drupal\fillpdf\FillPdfFormInterface $entity */
$entity = $this
->getEntity();
$code = $this->serializer
->getFormExportCode($entity);
$form = [];
$form['export'] = [
'#type' => 'textarea',
'#title' => $this
->t('FillPDF form configuration and mappings'),
'#default_value' => $code,
'#rows' => 30,
'#description' => $this
->t('Copy this code and then on the site you want to import to, go to the Edit page for the FillPDF form for which you want to import these mappings, and paste it in there.'),
'#attributes' => [
'style' => 'width: 97%;',
],
];
return $form;
}