public function StaticLayout::__construct

Overrides Drupal\Component\Plugin\PluginBase::__construct().

Overrides PluginBase::__construct

File

drupal/core/modules/layout/lib/Drupal/layout/Plugin/layout/layout/StaticLayout.php, line 26
Definition of Drupal\layout\Plugin\layout\layout\StaticLayout.

Class

StaticLayout
Plugin annotation @Plugin( id = "static_layout", derivative = "Drupal\layout\Plugin\Derivative\Layout" )

Namespace

Drupal\layout\Plugin\layout\layout

Code

public function __construct(array $configuration, $plugin_id, DiscoveryInterface $discovery) {

  // Get definition by discovering the declarative information.
  $definition = $discovery
    ->getDefinition($plugin_id);
  foreach ($definition['regions'] as $region => $title) {
    if (!isset($configuration['regions'][$region])) {
      $configuration['regions'][$region] = array();
    }
  }
  parent::__construct($configuration, $plugin_id, $discovery);
}