You are here

public function MenuManipulatorSettingsForm::__construct in Menu Manipulator 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Form/MenuManipulatorSettingsForm.php \Drupal\menu_manipulator\Form\MenuManipulatorSettingsForm::__construct()
  2. 8 src/Form/MenuManipulatorSettingsForm.php \Drupal\menu_manipulator\Form\MenuManipulatorSettingsForm::__construct()
  3. 2.0.x src/Form/MenuManipulatorSettingsForm.php \Drupal\menu_manipulator\Form\MenuManipulatorSettingsForm::__construct()

Constructs a MenuManipulatorSettingsForm object.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The factory for configuration objects.

\Drupal\Core\Entity\EntityStorageInterface $menu_storage: The menu storage service.

\Drupal\language\ConfigurableLanguageManagerInterface $language_manager: The language manager handler.

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler

Overrides ConfigFormBase::__construct

File

src/Form/MenuManipulatorSettingsForm.php, line 81

Class

MenuManipulatorSettingsForm
Configure custom settings for Menu Manipulators.

Namespace

Drupal\menu_manipulator\Form

Code

public function __construct(ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager, CacheBackendInterface $cache_menu, ModuleHandlerInterface $module_handler, EntityStorageInterface $menu_storage) {
  parent::__construct($config_factory);
  $this->languageManager = $language_manager;
  $this->menuCacheBackend = $cache_menu;
  $this->menus = $menu_storage
    ->loadMultiple();
  if ($module_handler
    ->moduleExists('block')) {
    $this->blockManager = \Drupal::service('plugin.manager.block');
  }
}