BootstrapLayoutsUpdate8402.php in Bootstrap Layouts 8.5
File
src/Plugin/BootstrapLayouts/Updates/BootstrapLayoutsUpdate8402.php
View source
<?php
namespace Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\Updates;
use Drupal\bootstrap_layouts\BootstrapLayout;
use Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\BootstrapLayoutsUpdateBase;
class BootstrapLayoutsUpdate8402 extends BootstrapLayoutsUpdateBase {
public function processExistingLayout(BootstrapLayout $layout, array $data = [], $display_messages = TRUE) {
if ($layout
->getId() !== 'bs_1col_stacked') {
return;
}
$regions = [
'header' => 'top',
'footer' => 'bottom',
];
foreach ($regions as $old_region => $new_region) {
if ($region = $layout
->getRegion($old_region)) {
$layout
->setRegion($new_region, $region);
$layout
->unsetRegion($old_region);
}
}
}
}