Render custom html below a custom form I am new to drupal, I am using drupal 8, I have develop a custom form by extending FormBase controller and i am trying to render it using a custom controller like below.

$form = $this-&gt;formBuilder-&gt;getForm('Drupal\xyz\Forms\XyzActionsForm',$parameter);

return [
  '#form'=&gt;$form
]


This works fine form me. But now i also want custom html below this form so try below code

$form = $this-&gt;formBuilder-&gt;getForm('Drupal\xyz\Forms\XyzActionsForm',$parameter);

$form = render(form);

$form .= '&lt;div&gt;custom html &lt;/div&gt;';

return [
  '#markup'=&gt;$form
]


But this didn't work for me, Can anyone let me know how to achieve this.
You have to use the power of render arrays.

For your example, I would use something like that :

$form_class = 'Drupal\xyz\Forms\XyzActionsForm';
$form = [
  'form' =&gt; $this-&gt;formBuilder-&gt;getForm($form_class, $parameter),
  'custom' =&gt; [
    '#type' =&gt; 'container',
    'inside' =&gt; [
      '#markup' =&gt; 'custom html', // Or use the power of render with html_tag type
    ],
  ],
];

return $form;


Then you can manage cache and other stuff on your render array and build your response with it.