You are here

public function ResponsiveLayout::__construct in Layout 8

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

Overrides PluginBase::__construct

File

lib/Drupal/rlayout/Plugin/layout/layout/ResponsiveLayout.php, line 26
Definition of Drupal\rlayout\Plugin\layout\layout\ResponsiveLayout.

Class

ResponsiveLayout
Plugin annotation @Plugin( id = "responsive_layout", derivative = "Drupal\rlayout\Plugin\Derivative\Layout" )

Namespace

Drupal\rlayout\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);
}