Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NavigationMenuBlock.php

function NavigationMenuBlock::blockForm

Overrides SystemMenuBlock::blockForm

File

core/modules/navigation/src/Plugin/Block/NavigationMenuBlock.php, line 57

Class

NavigationMenuBlock
Provides a generic menu navigation block.

Namespace

Drupal\navigation\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) : array {
    $form = parent::blockForm($form, $form_state);
    unset($form['menu_levels']['expand_all_items']);
    $form['menu_levels']['depth']['#options'] = range(1, static::NAVIGATION_MAX_DEPTH);
    return $form;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal