You are here

public function YamlForm::getSubmissionForm in YAML Form 8

Get form submission form.

Parameters

array $values: (optional) An array of values to set, keyed by property name.

string $operation: (optional) The operation identifying the form variation to be returned. Defaults to 'default'. This is typically used in routing.

Return value

array A render array representing a form submission form.

Overrides YamlFormInterface::getSubmissionForm

File

src/Entity/YamlForm.php, line 661

Class

YamlForm
Defines the form entity.

Namespace

Drupal\yamlform\Entity

Code

public function getSubmissionForm(array $values = [], $operation = 'default') {

  // Set this form's id.
  $values['yamlform_id'] = $this
    ->id();
  $yamlform_submission = $this
    ->entityTypeManager()
    ->getStorage('yamlform_submission')
    ->create($values);
  return \Drupal::service('entity.form_builder')
    ->getForm($yamlform_submission, $operation);
}