How to render a form programmatically in drupal 8?

Public

Warning message

We recommend you to assign at least one category to this snippet so you could easily navigate it in the future. Edit your snippet here.
</> CopyGet raw version
php
  1. /**
  2.   * {@inheritdoc}
  3.   */
  4. public function build() {
  5. return \Drupal::formBuilder()->getForm('Drupal\bmi\Form\BmiForm');
  6. }