By editor, 10 February, 2017 Question How to get HTML from drupal 8 renderer array ? How to convert Render array into HTML output code ? Example : $result = array( '#markup' => 'Hello. This is my First Page', ); $renderer = \Drupal::service('renderer'); $html = $renderer->render($result); Render outside of the Render context: $renderer = \Drupal::service('renderer'); $html = $renderer->renderPlain($result); #OR $html = $renderer->renderRoot($result); Tags Drupal 8 Code Module Display contents using Drupal8 Render API Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments