You are here

public function OgMenuBlock::getMenuName in Organic Groups Menu (OG Menu) 8

Returns a name for the og menu.

Return value

string|null The name of the menu, or null if no menu instance is found.

2 calls to OgMenuBlock::getMenuName()
OgMenuBlock::build in src/Plugin/Block/OgMenuBlock.php
Builds and returns the renderable array for this block plugin.
OgMenuBlock::getCacheTags in src/Plugin/Block/OgMenuBlock.php
The cache tags associated with this object.

File

src/Plugin/Block/OgMenuBlock.php, line 293

Class

OgMenuBlock
Provides a generic Menu block.

Namespace

Drupal\og_menu\Plugin\Block

Code

public function getMenuName() {
  if (isset($this->menu_name)) {
    return $this->menu_name;
  }
  $instance = $this
    ->getOgMenuInstance();
  if ($instance) {
    $this->menu_name = 'ogmenu-' . $instance
      ->id();
  }
  return $this->menu_name;
}