You are here

public function WebformThemeManager::renderPlain in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformThemeManager.php \Drupal\webform\WebformThemeManager::renderPlain()

Renders using the default theme final HTML in situations where no assets are needed.

Parameters

array $elements: The structured array describing the data to be rendered.

bool $default_theme: Render using the default theme. Defaults to TRUE.

Return value

\Drupal\Component\Render\MarkupInterface The rendered HTML.

Overrides WebformThemeManagerInterface::renderPlain

File

src/WebformThemeManager.php, line 189

Class

WebformThemeManager
Defines a class to manage webform theming.

Namespace

Drupal\webform

Code

public function renderPlain(array &$elements, $theme_name = NULL) {
  if ($theme_name !== NULL) {
    $this
      ->setCurrentTheme($theme_name);
  }
  $markup = $this->renderer
    ->renderPlain($elements);
  if ($theme_name !== NULL) {
    $this
      ->setActiveTheme();
  }
  return $markup;
}