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' => array(1)
→'class' => 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()->getForm();
but no luck. Thanks
Drupal\contact\ContactFormEditForm
. Not sure there's an easy way to find that out unless you know it's an entity form though. The best way might be to look under the module'ssrc
folder for files whose name ends withForm.php
. I think that's a safe convention to follow