You are here

public function TBMegaMenuBuilder::editColumnConfig in The Better Mega Menu 2.x

Same name and namespace in other branches
  1. 8 src/TBMegaMenuBuilder.php \Drupal\tb_megamenu\TBMegaMenuBuilder::editColumnConfig()

Set the default values to configuration in columns if it's empty.

Parameters

array $col_config: The array to fill with default values.

Overrides TBMegaMenuBuilderInterface::editColumnConfig

File

src/TBMegaMenuBuilder.php, line 192

Class

TBMegaMenuBuilder
Defines a TBMegaMenuBuilder.

Namespace

Drupal\tb_megamenu

Code

public function editColumnConfig(array &$col_config) {
  $attributes = [
    'width' => 12,
    'class' => '',
    'hidewcol' => 0,
    'showblocktitle' => 0,
  ];
  foreach ($attributes as $attribute => $value) {
    if (!isset($col_config[$attribute])) {
      $col_config[$attribute] = $value;
    }
  }
}