protected function doActive($href, $label)
{
if (is_array($this->active) && array_key_exists('callback', $this->active)) {
$this->active = $this->active['callback'];
}
if ($this->active) {
// Find active path in array
if (is_array($this->active) && count($this->active) > 0) {
$result = array_search($href, $this->active);
if ($result !== false) {
unset($this->active[$result]);
return 'class="active"';
}
} elseif ($this->active instanceof Closure) {
call_user_func_array($this->active, [$this, $href, $label]);
$attrs = $this->renderAttr($this->optionAttr);
$this->optionAttr = null;
return $attrs;
} else {
if ($this->active == $href) {
$this->active = null;
return 'class="active"';
}
}
}
}