function MenuTreeParameters::setActiveTrail

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuTreeParameters.php \Drupal\Core\Menu\MenuTreeParameters::setActiveTrail()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuTreeParameters.php \Drupal\Core\Menu\MenuTreeParameters::setActiveTrail()
  3. 11.x core/lib/Drupal/Core/Menu/MenuTreeParameters.php \Drupal\Core\Menu\MenuTreeParameters::setActiveTrail()

Sets the active trail IDs used to set the inActiveTrail property.

@codeCoverageIgnore

Parameters

string[] $active_trail: An array containing the active trail: a list of menu link plugin IDs.

Return value

$this

See also

\Drupal\Core\Menu\MenuActiveTrail::getActiveTrailIds()

File

core/lib/Drupal/Core/Menu/MenuTreeParameters.php, line 144

Class

MenuTreeParameters
Provides a value object to model menu tree parameters.

Namespace

Drupal\Core\Menu

Code

public function setActiveTrail(array $active_trail) {
    $this->activeTrail = $active_trail;
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.