Programmatically get a form in Drupal 8 The documentation states:


  The argument passed to the getForm() method is the name of the class
  that defines your form and is an implementation of
  \Drupal\Core\Form\FormBuilderInterface.


How do I find out the name of the class that defines the website feedback form provided by the core contact module (the form id is: feedback_contact_message_form).

When I dpm() the form I can see that there is a class defined:

$input array(30)
  →'#attributes' =&gt; array(1)
    →'class' =&gt; array(3)
      string(29) "feedback-contact-message-form"
      string(20) "contact-message-form"
      string(12) "contact-form"


I tried various forms of this as the parameter to pass to:

\Drupal::formBuilder()-&gt;getForm();


but no luck. Thanks
This renders within a block plugin:

class myModule extends BlockBase {
  public function build() {

    $default_form = \Drupal::config('contact.settings')-&gt;get('default_form');
    $entity = \Drupal::entityManager()-&gt;getStorage('contact_form')-&gt;load($default_form);

    $message = \Drupal::entityManager()
      -&gt;getStorage('contact_message')
      -&gt;create(array(
        'contact_form' =&gt; $entity-&gt;id(),
      ));

    $form = \Drupal::service('entity.form_builder')-&gt;getForm($message);

    return $form;
  }
}