You are here

public function CheeseburgerMenuItem::setIsInActiveTrail in Cheeseburger Menu 5.0.x

Adds is in active trail class.

Parameters

bool $is_in_active_trail: Is in active trail.

Return value

static The object itself for chaining.

File

src/CheeseburgerMenuItem.php, line 331

Class

CheeseburgerMenuItem
Cheeseburger menu item class.

Namespace

Drupal\cheeseburger_menu

Code

public function setIsInActiveTrail($is_in_active_trail = TRUE) {
  if ($is_in_active_trail) {
    $this->attribute
      ->addClass('in-active-trail');
  }
  else {
    $this->attribute
      ->removeClass('in-active-trail');
  }
  return $this;
}