$this->configuration
['expand_all_items'
] =
$form_state->
getValue('expand_all_items'
);
} /**
* {@inheritdoc}
*/
public function build() { $menu_name =
$this->
getDerivativeId();
if ($this->configuration
['expand_all_items'
]) { $parameters =
new MenuTreeParameters();
$active_trail =
$this->menuActiveTrail->
getActiveTrailIds($menu_name);
$parameters->
setActiveTrail($active_trail);
} else { $parameters =
$this->menuTree->
getCurrentRouteMenuTreeParameters($menu_name);
} // Adjust the menu tree parameters based on the block's configuration.
$level =
$this->configuration
['level'
];
$depth =
$this->configuration
['depth'
];
$parameters->
setMinDepth($level);
// When the depth is configured to zero, there is no depth limit. When depth
// is non-zero, it indicates the number of levels that must be displayed.