You are here

public function TBMegaMenuBuilder::getIdColumn in The Better Mega Menu 8

Same name and namespace in other branches
  1. 2.x src/TBMegaMenuBuilder.php \Drupal\tb_megamenu\TBMegaMenuBuilder::getIdColumn()

Get Id of column.

Parameters

int $number_columns: The number of columns.

Return value

string The column id.

Overrides TBMegaMenuBuilderInterface::getIdColumn

File

src/TBMegaMenuBuilder.php, line 222

Class

TBMegaMenuBuilder
Defines a TBMegaMenuBuilder.

Namespace

Drupal\tb_megamenu

Code

public function getIdColumn(int $number_columns) {
  $value =& drupal_static('column');
  if (!isset($value)) {
    $value = 1;
  }
  elseif (!$number_columns || $value < $number_columns) {
    $value++;
  }
  return "tb-megamenu-column-{$value}";
}