You are here

public function BootstrapLayoutsBase::defaultConfiguration in Bootstrap Layouts 8.5

Same name and namespace in other branches
  1. 8.4 src/Plugin/Layout/BootstrapLayoutsBase.php \Drupal\bootstrap_layouts\Plugin\Layout\BootstrapLayoutsBase::defaultConfiguration()

Gets default configuration for this plugin.

Return value

array An associative array with the default configuration.

Overrides LayoutDefault::defaultConfiguration

1 call to BootstrapLayoutsBase::defaultConfiguration()
BootstrapLayoutsBase::setConfiguration in src/Plugin/Layout/BootstrapLayoutsBase.php
Sets the configuration for this plugin instance.

File

src/Plugin/Layout/BootstrapLayoutsBase.php, line 43

Class

BootstrapLayoutsBase
Layout class for all bootstrap layouts.

Namespace

Drupal\bootstrap_layouts\Plugin\Layout

Code

public function defaultConfiguration() {
  $configuration = parent::defaultConfiguration();
  $configuration += [
    'layout' => [
      'wrapper' => 'div',
      'classes' => [
        'row',
      ],
      'attributes' => '',
      'add_layout_class' => TRUE,
    ],
    'regions' => [],
  ];
  foreach ($this
    ->getPluginDefinition()
    ->getRegions() as $region => $info) {
    $region_configuration = [];
    foreach ([
      'wrapper',
      'classes',
      'attributes',
    ] as $key) {
      if (isset($info[$key])) {
        $region_configuration[$key] = $info[$key];
      }
    }
    $configuration['regions'][$region] = $region_configuration + $this
      ->getRegionDefaults();
  }
  return $configuration;
}