Rendering contact_form I have call my current contactform with this function in mytheme.theme.

$form = Drupal::routeMatch()-&gt;getParameter('contact_form');


I have this

object(Drupal\contact\Entity\ContactForm)#412 (23) {
  ["id":protected]=&gt;
  string(8) "feedback"
  ["label":protected]=&gt;
  string(14) "Nous contacter"
  ["recipients":protected]=&gt;
  array(1) {
    [0]=&gt;
    string(21) "mymail@gmail.com"
  }
  ["reply":protected]=&gt;
  string(0) ""
  ["weight":protected]=&gt;
  int(0)
  ["originalId":protected]=&gt;
  string(8) "feedback"
  ["pluginConfigKey":protected]=&gt;
  NULL
  ["status":protected]=&gt;
  bool(true)
  ["uuid":protected]=&gt;
  string(36) "6e997e8b-9d85-4e59-9e43-67004270fe13"
  ["isSyncing":"Drupal\Core\Config\Entity\ConfigEntityBase":private]=&gt;
  bool(false)
  ["isUninstalling":"Drupal\Core\Config\Entity\ConfigEntityBase":private]=&gt;
  bool(false)
  ["langcode":protected]=&gt;
  string(2) "fr"
  ["third_party_settings":protected]=&gt;
  array(0) {
  }
  ["_core":protected]=&gt;
  array(0) {
  }
  ["trustedData":protected]=&gt;
  bool(false)
  ["entityTypeId":protected]=&gt;
  string(12) "contact_form"
  ["enforceIsNew":protected]=&gt;
  NULL
  ["typedData":protected]=&gt;
  NULL
  ["cacheContexts":protected]=&gt;
  array(1) {
    [0]=&gt;
    string(28) "languages:language_interface"
  }
  ["cacheTags":protected]=&gt;
  array(0) {
  }
  ["cacheMaxAge":protected]=&gt;
  int(-1)
  ["_serviceIds":protected]=&gt;
  array(0) {
  }
  ["dependencies":protected]=&gt;
  array(0) {
  }
}


But how can I rendering this ? My goal is to render the current contact form. 

Edit1: I have tried this How to programmatically render a contact form in a theme in D8

But when I try this 

    $form = Drupal::routeMatch()-&gt;getParameter('contact_form');//get the current form called
    $message = \Drupal::entityManager()
      -&gt;getStorage('contact_message')
      -&gt;create(array(
        'contact_form' =&gt; $form-&gt;id(),
      ));
//$form-&gt;id() = 'feedback'
        $form = Drupal::service('entity.form_builder')-&gt;getForm($message);


I have a very big array (Firefox and Chrome crash when in print them ) 

When I try this

$form = Drupal::routeMatch()-&gt;getParameter('contact_form');//get the current form called
ContactController::contactSitePage($form);


I have this error

PHP Fatal error: Call to a member function getStorage() on null in /var/www/drupal8/core/modules/contact/src/Controller/ContactController.php on line 83


Why I would like to do this in my .theme file ?

Because I have begin to migrate a website in drupal 6 to drupal 8 .(I have try Drupal Upgrate and they works very good ) The page of this website has been built with a little home framework. It call many others not Drupal script. With this, not Drupal Script (Ex:tagada.com/horoscope.php ) and drupal page ( tagada.com/drupalpart/node/10) works with same css and html structure file in a external folder. In Drupal6 the theme worked correctly with a global variable object with node content $node
Finnaly I have find the answer to my problem's .

It was a drupal permission problem's . 

User Anonymous users do not have permission to use the general contact form. I gave permission and everything worked .

Thank you alot for the advice .