You are here

MenuBlock.php in Colossal Menu 2.x

Same filename in this branch
  1. 2.x src/Plugin/Derivative/MenuBlock.php
  2. 2.x src/Plugin/Block/MenuBlock.php
Same filename and directory in other branches
  1. 8 src/Plugin/Block/MenuBlock.php

File

src/Plugin/Block/MenuBlock.php
View source
<?php

namespace Drupal\colossal_menu\Plugin\Block;

use Drupal\system\Plugin\Block\SystemMenuBlock;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides a generic Colossal Menu block.
 *
 * @Block(
 *   id = "colossal_menu_block",
 *   admin_label = @Translation("Colossal Menu"),
 *   category = @Translation("Colossal Menus"),
 *   deriver = "Drupal\colossal_menu\Plugin\Derivative\MenuBlock"
 * )
 */
class MenuBlock extends SystemMenuBlock {

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('colossal_menu.link_tree'), $container
      ->get('menu.active_trail'));
  }

}

Classes

Namesort descending Description
MenuBlock Provides a generic Colossal Menu block.