title: How to render custom form inside a custom block programmatically with drupal 8?
body: <p>I need render a custom form in a custom block programmatically. This is my code inside a controller:</p>
  
  <pre><code>  $form = \Drupal::formBuilder()-&gt;getForm('Drupal\wa_encuesta\Form\NewForm', $extra);
  [enter image description here][1]  $form=render($form);
  
    $blockContent = BlockContent::create([
      'info' =&gt; $title,
      'type' =&gt; 'basic',
      'body'=&gt;[
        'value' =&gt; $form,
        'format' =&gt; 'full_html'
      ]
    ]);
    $blockContent-&gt;save();
  
   //$block = Block::create([
   $block =  \Drupal\block\Entity\Block::create([
     'id' =&gt; 'about_us',
     'plugin' =&gt; 'block_content:' . $blockContent-&gt;uuid(),
     'region' =&gt; 'header',
     'provider' =&gt; 'block_content',
     'weight' =&gt; -100,
     'theme' =&gt; \Drupal::config('system.theme')-&gt;get('default'),
     'visibility' =&gt; array(),
     'settings' =&gt; [
       'label' =&gt; 'About us',
       'label_display' =&gt; FALSE,
     ],
   ]);
   $block-&gt;save();
  </code></pre>
  
  <p>The form render a custom block but this not working when submit. </p>
  
  <p><img src="https://i.stack.imgur.com/NO6Kk.png" alt="enter image description here"></p>