You are here

public static function MenuBlock::create in Colossal Menu 2.x

Same name in this branch
  1. 2.x src/Plugin/Derivative/MenuBlock.php \Drupal\colossal_menu\Plugin\Derivative\MenuBlock::create()
  2. 2.x src/Plugin/Block/MenuBlock.php \Drupal\colossal_menu\Plugin\Block\MenuBlock::create()
Same name and namespace in other branches
  1. 8 src/Plugin/Block/MenuBlock.php \Drupal\colossal_menu\Plugin\Block\MenuBlock::create()

Creates an instance of the plugin.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container to pull out services used in the plugin.

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Return value

static Returns an instance of this plugin.

Overrides SystemMenuBlock::create

File

src/Plugin/Block/MenuBlock.php, line 23

Class

MenuBlock
Provides a generic Colossal Menu block.

Namespace

Drupal\colossal_menu\Plugin\Block

Code

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'));
}