You are here

public static function DashboardLazyBuildBase::lazyBuildPreRender in Dashboards with Layout Builder 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/DashboardLazyBuildBase.php \Drupal\dashboards\Plugin\DashboardLazyBuildBase::lazyBuildPreRender()

Helper for lazy build render.

Parameters

string $pluginId: Dashboard plugin id.

string $configuration: Serizalized configuration.

Return value

array Renderable array

Overrides DashboardLazyBuildInterface::lazyBuildPreRender

File

src/Plugin/DashboardLazyBuildBase.php, line 15

Class

DashboardLazyBuildBase
Abstract class helper for lazy builds.

Namespace

Drupal\dashboards\Plugin

Code

public static function lazyBuildPreRender(string $pluginId, string $configuration) : array {
  $configuration = Json::decode($configuration);
  $plugin = \Drupal::service('plugin.manager.dashboard')
    ->createInstance($pluginId, $configuration);
  return static::lazyBuild($plugin, $configuration);
}