Problem/Motivation

I would like to render the submission edit form into the renderarray.

(The background functionality to implement is that i can render more then 1 edit form on a html page which can then be exported to 1 pdf file and can be send to the customer)

I found in my code the SID, in my case 351, of the the submission and I can also render the submission form:

$webform = $s->getWebform();
$webform = $webform->getSubmissionForm();
$renderarray = $webform;

So how to render the edit form which is available on routing path:
'/admin/structure/webform/manage/{webform}/submission/{webform_submission}/edit'
by code?

Comments

cilefen’s picture

Issue tags: -render webform submission
The Webform module's issue queue is for bugs, feature requests, and planning. Please post general support questions to Drupal Answers. You can also ask questions or help answer questions on the #webform channel on Drupal Slack.
jrockowitz’s picture

Status: Active » Closed (works as designed)

You can try using a webform element.

    // Webform.
    $build['webform'] = [
      '#type' => 'webform',
      '#webform' => 'my_webform_id,
      '#sid' => 99999,
    ];