You are here

public function JanrainMarkupBuilder::getScreenRenderArray in Janrain Registration 8

Get Janrain screen render array.

Parameters

string $name: Screen name.

Return value

array Janrain screen render array.

File

src/JanrainMarkupBuilder.php, line 98

Class

JanrainMarkupBuilder
Builds needed markup for including Janrain functionality in HTML page.

Namespace

Drupal\janrain_capture

Code

public function getScreenRenderArray(string $name) : array {
  $build = [];
  $build["{$name}_screen_html"] = [
    '#markup' => '',
    '#children' => $this->screenLoaderManager
      ->getScreen($name, 'html'),
  ];
  $build["{$name}_screen_js"] = [
    '#tag' => 'script',
    '#type' => 'html_tag',
    '#value' => Markup::create($this->screenLoaderManager
      ->getScreen($name, 'js')),
  ];
  return $build;
}