Building a simple render array and rendering it I'm trying to render a render array. This render array will be configurable through a UI.

For some reason, I'm unable to render it.

I've isolated the issue so we can replicate it quickly.

Here's the render array:

$render_array = array(
  '#type' =&gt; 'html_tag',
  '#tag' =&gt; 'h1',
  '#attributes' =&gt; array('class' =&gt; 'title'),
  'children' =&gt; array(
    array(
      '#type' =&gt; 'link',
      '#title' =&gt; 'Link title',
      '#href' =&gt; 'Link URL',
      '#attributes' =&gt; array('class' =&gt; 'inner'),
    )
  )
);

$html = render($render_array);

debug($html);


The result of this is:

&lt;h1 class="title" /&gt;


I tried many possibilities, tested multiple things... but it won't work.

I also searched the API and found this comment and the example in the comment is pretty much the same as mine... but it won't work either.

Is there an easy why to build a complete HTML structure with a render array ?

I could use '#theme' =&gt; 'link' but it's not advised, see this thread.

Anyone got a clue ?

Thanks!

Edit1: I opened an issue on Drupal.org which is a workaround to get this fixed.
I believe "children" needs to have a "#" ... You could also try using #value instead of children